finished adding github's pages support

This commit is contained in:
Do Nhat Minh 2013-04-21 21:03:56 +08:00 committed by Brit Butler
parent 6396e136d3
commit bf6ba24434
3 changed files with 9 additions and 6 deletions

View file

@ -13,7 +13,8 @@
:inferior-shell :inferior-shell
:cl-fad :cl-fad
:cl-ppcre :cl-ppcre
:closer-mop) :closer-mop
:puri)
:serial t :serial t
:components ((:file "packages") :components ((:file "packages")
(:file "util") (:file "util")

View file

@ -51,7 +51,7 @@ Additional args to render CONTENT can be passed via RENDER-ARGS."
(when (probe-file dir) (when (probe-file dir)
(run-program "cp -R ~a ." dir))) (run-program "cp -R ~a ." dir)))
(do-ctypes (publish ctype)) (do-ctypes (publish ctype))
(render-indices) (render-indices (not (github *config*)))
(render-feeds (feeds *config*)))) (render-feeds (feeds *config*))))
(defgeneric deploy (staging) (defgeneric deploy (staging)
@ -65,8 +65,8 @@ Additional args to render CONTENT can be passed via RENDER-ARGS."
(run-program "mv ~a ~a" staging new-build) (run-program "mv ~a ~a" staging new-build)
(when (github *config*) (when (github *config*)
(let ((cname-filename (rel-path "" "~a/CNAME" new-build)) (let ((cname-filename (rel-path "" "~a/CNAME" new-build))
(stripped-url (subseq (domain *config*) (stripped-url (puri:uri-host (puri:parse-uri
(+ 2 (position #\/ (domain *config*)))))) (domain *config*)))))
(format t "~a" cname-filename) (format t "~a" cname-filename)
(with-open-file (cname cname-filename (with-open-file (cname cname-filename
:direction :output :direction :output

View file

@ -67,7 +67,7 @@
:posts (subseq content start end) :posts (subseq content start end)
:title "Recent Posts"))) :title "Recent Posts")))
(defun render-indices () (defun render-indices (make-symlink-p)
"Render the indices to view content in groups of size N, by month, and by tag." "Render the indices to view content in groups of size N, by month, and by tag."
(let ((results (by-date (hash-table-values *content*)))) (let ((results (by-date (hash-table-values *content*))))
(dolist (tag (all-tags)) (dolist (tag (all-tags))
@ -83,4 +83,6 @@
:prev (and (plusp i) i) :prev (and (plusp i) i)
:next (and (< (* (1+ i) 10) (length results)) :next (and (< (* (1+ i) 10) (length results))
(+ 2 i))))))) (+ 2 i)))))))
(update-symlink "index.html" "1.html")) (if make-symlink
(update-symlink "index.html" "1.html")
(run-program "cp 1.html index.html")))