diff --git a/coleslaw.asd b/coleslaw.asd index a25f13f..4f427a9 100644 --- a/coleslaw.asd +++ b/coleslaw.asd @@ -13,7 +13,8 @@ :inferior-shell :cl-fad :cl-ppcre - :closer-mop) + :closer-mop + :puri) :serial t :components ((:file "packages") (:file "util") diff --git a/src/coleslaw.lisp b/src/coleslaw.lisp index 5355696..f59a202 100644 --- a/src/coleslaw.lisp +++ b/src/coleslaw.lisp @@ -51,7 +51,7 @@ Additional args to render CONTENT can be passed via RENDER-ARGS." (when (probe-file dir) (run-program "cp -R ~a ." dir))) (do-ctypes (publish ctype)) - (render-indices) + (render-indices (not (github *config*))) (render-feeds (feeds *config*)))) (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) (when (github *config*) (let ((cname-filename (rel-path "" "~a/CNAME" new-build)) - (stripped-url (subseq (domain *config*) - (+ 2 (position #\/ (domain *config*)))))) + (stripped-url (puri:uri-host (puri:parse-uri + (domain *config*))))) (format t "~a" cname-filename) (with-open-file (cname cname-filename :direction :output diff --git a/src/indices.lisp b/src/indices.lisp index fd16223..bdac10a 100644 --- a/src/indices.lisp +++ b/src/indices.lisp @@ -67,7 +67,7 @@ :posts (subseq content start end) :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." (let ((results (by-date (hash-table-values *content*)))) (dolist (tag (all-tags)) @@ -83,4 +83,6 @@ :prev (and (plusp i) i) :next (and (< (* (1+ i) 10) (length results)) (+ 2 i))))))) - (update-symlink "index.html" "1.html")) + (if make-symlink + (update-symlink "index.html" "1.html") + (run-program "cp 1.html index.html")))