Fix gh-pages recursive call by renaming deploy->deploy-dir.
This commit is contained in:
parent
c7b36f65c3
commit
e12f5edc79
10 changed files with 40 additions and 30 deletions
|
@ -19,7 +19,7 @@
|
||||||
|
|
||||||
* **New markup formats**, for example the [ReStructuredText plugin](http://github.com/redline6561/coleslaw/blob/master/plugins/rst.lisp), can be created by definining an appropriate `render-content` method. The method takes `text` and `format` arguments and is [EQL-specialized](http://www.gigamonkeys.com/book/object-reorientation-generic-functions.html#defmethod) on the format. Format should be a keyword matching the file extension (or pathname-type) of the markup format. (eg. `:rst` for ReStructuredText)
|
* **New markup formats**, for example the [ReStructuredText plugin](http://github.com/redline6561/coleslaw/blob/master/plugins/rst.lisp), can be created by definining an appropriate `render-content` method. The method takes `text` and `format` arguments and is [EQL-specialized](http://www.gigamonkeys.com/book/object-reorientation-generic-functions.html#defmethod) on the format. Format should be a keyword matching the file extension (or pathname-type) of the markup format. (eg. `:rst` for ReStructuredText)
|
||||||
|
|
||||||
* **New hosting options**, for example the [Amazon S3 plugin](http://github.com/redline6561/coleslaw/blob/master/plugins/s3.lisp), can be created by definining a `deploy :after` method. The method takes a staging directory, likely uninteresting in the `:after` stage. But by importing `*config*` from the coleslaw package and getting its deploy location with `(deploy *config*)` a number of interesting options become possible.
|
* **New hosting options**, for example the [Amazon S3 plugin](http://github.com/redline6561/coleslaw/blob/master/plugins/s3.lisp), can be created by definining a `deploy :after` method. The method takes a staging directory, likely uninteresting in the `:after` stage. But by importing `*config*` from the coleslaw package and getting its deploy location with `(deploy-dir *config*)` a number of interesting options become possible.
|
||||||
|
|
||||||
* **New content types**, for example a bookmark-like content type such as ["shouts"](http://paste.lisp.org/display/134453). This has not yet been attempted as a plugin but should be possible without much difficulty.
|
* **New content types**, for example a bookmark-like content type such as ["shouts"](http://paste.lisp.org/display/134453). This has not yet been attempted as a plugin but should be possible without much difficulty.
|
||||||
|
|
||||||
|
|
|
@ -1,18 +1,20 @@
|
||||||
(("/home/coleslaw/tmp/lisp-is-fun/" . (:author "Ralph Moritz"
|
(("/home/coleslaw/tmp/lisp-is-fun/" . (:author "Ralph Moritz"
|
||||||
:deploy "/home/coleslaw/www/lisp-is-fun/"
|
:deploy-dir "/home/coleslaw/www/lisp-is-fun/"
|
||||||
:domain "http://blub.co.za"
|
:domain "http://blub.co.za"
|
||||||
:feeds ("lisp")
|
:feeds ("lisp")
|
||||||
:plugins ((mathjax))
|
:plugins ((mathjax))
|
||||||
:sitenav ((:url "http://twitter.com/ralph_moeritz" :name "Twitter")
|
:sitenav ((:url "http://twitter.com/ralph_moeritz" :name "Twitter")
|
||||||
(:url "http://github.com/ralph-moeritz" :name "Code"))
|
(:url "http://github.com/ralph-moeritz" :name "Code"))
|
||||||
|
:staging-dir "/tmp/coleslaw"
|
||||||
:title "(lisp :is 'fun)"
|
:title "(lisp :is 'fun)"
|
||||||
:theme "hyde"))
|
:theme "hyde"))
|
||||||
("/home/coleslaw/tmp/musings/" . (:author "Ralph Moritz"
|
("/home/coleslaw/tmp/musings/" . (:author "Ralph Moritz"
|
||||||
:deploy "/home/coleslaw/www/musings/"
|
:deploy-dir "/home/coleslaw/www/musings/"
|
||||||
:domain "http://musings.co.za"
|
:domain "http://musings.co.za"
|
||||||
:feeds ("opinion")
|
:feeds ("opinion")
|
||||||
:plugins ((mathjax))
|
:plugins ((mathjax))
|
||||||
:sitenav ((:url "http://twitter.com/ralph_moeritz" :name "Twitter")
|
:sitenav ((:url "http://twitter.com/ralph_moeritz" :name "Twitter")
|
||||||
(:url "http://github.com/ralph-moeritz" :name "Code"))
|
(:url "http://github.com/ralph-moeritz" :name "Code"))
|
||||||
|
:staging-dir "/tmp/coleslaw"
|
||||||
:title "Musings"
|
:title "Musings"
|
||||||
:theme "hyde")))
|
:theme "hyde")))
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
(:author "Brit Butler"
|
(:author "Brit Butler"
|
||||||
:deploy "/home/git/blog/"
|
:deploy-dir "/home/git/blog/"
|
||||||
:domain "http://blog.redlinernotes.com"
|
:domain "http://blog.redlinernotes.com"
|
||||||
:feeds ("lisp")
|
:feeds ("lisp")
|
||||||
:plugins ((mathjax)
|
:plugins ((mathjax)
|
||||||
|
@ -11,5 +11,6 @@
|
||||||
(:url "http://github.com/redline6561" :name "Code")
|
(:url "http://github.com/redline6561" :name "Code")
|
||||||
(:url "http://soundcloud.com/redlinernotes" :name "Music")
|
(:url "http://soundcloud.com/redlinernotes" :name "Music")
|
||||||
(:url "http://redlinernotes.com/docs/talks/" :name "Talks"))
|
(:url "http://redlinernotes.com/docs/talks/" :name "Talks"))
|
||||||
|
:staging-dir "/tmp/coleslaw/"
|
||||||
:title "Improved Means for Achieving Deteriorated Ends"
|
:title "Improved Means for Achieving Deteriorated Ends"
|
||||||
:theme "hyde")
|
:theme "hyde")
|
||||||
|
|
|
@ -4,7 +4,11 @@
|
||||||
(defpackage :coleslaw-gh-pages
|
(defpackage :coleslaw-gh-pages
|
||||||
(:use :cl)
|
(:use :cl)
|
||||||
(:import-from :puri #:parse-uri #:uri-host)
|
(:import-from :puri #:parse-uri #:uri-host)
|
||||||
(:import-from :coleslaw #:*config* #:deploy #:domain #:rel-path)
|
(:import-from :coleslaw #:*config*
|
||||||
|
#:deploy
|
||||||
|
#:deploy-dir
|
||||||
|
#:domain
|
||||||
|
#:rel-path)
|
||||||
(:export #:enable))
|
(:export #:enable))
|
||||||
|
|
||||||
(in-package :coleslaw-gh-pages)
|
(in-package :coleslaw-gh-pages)
|
||||||
|
@ -13,10 +17,10 @@
|
||||||
"The domain CNAME for github to serve pages from.")
|
"The domain CNAME for github to serve pages from.")
|
||||||
|
|
||||||
(defmethod deploy :after (staging)
|
(defmethod deploy :after (staging)
|
||||||
(let ((base (truename (rel-path (deploy *config*) ".curr"))))
|
(let ((blog (truename (rel-path (deploy-dir *config*) ".curr"))))
|
||||||
(delete-file (rel-path base "index.html"))
|
(delete-file (rel-path blog "index.html"))
|
||||||
(cl-fad:copy-file (rel-path base "1.html") (rel-path base "index.html"))
|
(cl-fad:copy-file (rel-path blog "1.html") (rel-path blog "index.html"))
|
||||||
(with-open-file (out (rel-path base "CNAME")
|
(with-open-file (out (rel-path blog "CNAME")
|
||||||
:direction :output
|
:direction :output
|
||||||
:if-exists :supersede
|
:if-exists :supersede
|
||||||
:if-does-not-exist :create)
|
:if-does-not-exist :create)
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
(defpackage :coleslaw-s3
|
(defpackage :coleslaw-s3
|
||||||
(:use :cl)
|
(:use :cl)
|
||||||
(:import-from :coleslaw #:deploy
|
(:import-from :coleslaw #:deploy
|
||||||
|
#:deploy-dir
|
||||||
#:*config*)
|
#:*config*)
|
||||||
(:export #:enable))
|
(:export #:enable))
|
||||||
|
|
||||||
|
@ -45,7 +46,7 @@ and the secret key on the second.")
|
||||||
(cl-fad:walk-directory dir #'upload)))
|
(cl-fad:walk-directory dir #'upload)))
|
||||||
|
|
||||||
(defmethod deploy :after (staging)
|
(defmethod deploy :after (staging)
|
||||||
(let ((blog (deploy *config*)))
|
(let ((blog (deploy-dir *config*)))
|
||||||
(loop for key across (zs3:all-keys *bucket*)
|
(loop for key across (zs3:all-keys *bucket*)
|
||||||
do (setf (gethash (zs3:etag key) *cache*) key))
|
do (setf (gethash (zs3:etag key) *cache*) key))
|
||||||
(dir->s3 blog)
|
(dir->s3 blog)
|
||||||
|
|
|
@ -57,7 +57,7 @@ Additional args to render CONTENT can be passed via RENDER-ARGS."
|
||||||
(defgeneric deploy (staging)
|
(defgeneric deploy (staging)
|
||||||
(:documentation "Deploy the STAGING dir, updating the .prev and .curr symlinks.")
|
(:documentation "Deploy the STAGING dir, updating the .prev and .curr symlinks.")
|
||||||
(:method (staging)
|
(:method (staging)
|
||||||
(let* ((dest (deploy *config*))
|
(let* ((dest (deploy-dir *config*))
|
||||||
(new-build (rel-path dest "generated/~a" (get-universal-time)))
|
(new-build (rel-path dest "generated/~a" (get-universal-time)))
|
||||||
(prev (rel-path dest ".prev"))
|
(prev (rel-path dest ".prev"))
|
||||||
(curr (rel-path dest ".curr")))
|
(curr (rel-path dest ".curr")))
|
||||||
|
@ -75,8 +75,9 @@ compile and deploy the blog."
|
||||||
(load-config config-key)
|
(load-config config-key)
|
||||||
(load-content)
|
(load-content)
|
||||||
(compile-theme (theme *config*))
|
(compile-theme (theme *config*))
|
||||||
(compile-blog (staging *config*))
|
(let ((blog (staging-dir *config*)))
|
||||||
(deploy (staging *config*)))
|
(compile-blog blog)
|
||||||
|
(deploy blog)))
|
||||||
|
|
||||||
(defun preview (path &optional (content-type 'post))
|
(defun preview (path &optional (content-type 'post))
|
||||||
"Render the content at PATH under user's configured repo and save it to
|
"Render the content at PATH under user's configured repo and save it to
|
||||||
|
|
|
@ -1,17 +1,17 @@
|
||||||
(in-package :coleslaw)
|
(in-package :coleslaw)
|
||||||
|
|
||||||
(defclass blog ()
|
(defclass blog ()
|
||||||
((author :initarg :author :initform "" :accessor author)
|
((author :initarg :author :accessor author)
|
||||||
(deploy :initarg :deploy :initform nil :accessor deploy)
|
(deploy-dir :initarg :deploy-dir :accessor deploy-dir)
|
||||||
(domain :initarg :domain :initform "" :accessor domain)
|
(domain :initarg :domain :accessor domain)
|
||||||
(feeds :initarg :feeds :initform nil :accessor feeds)
|
(feeds :initarg :feeds :accessor feeds)
|
||||||
(license :initarg :license :initform nil :accessor license)
|
(license :initarg :license :accessor license)
|
||||||
(plugins :initarg :plugins :initform nil :accessor plugins)
|
(plugins :initarg :plugins :accessor plugins)
|
||||||
(repo :initarg :repo :initform #p"/" :accessor repo)
|
(repo :initarg :repo :accessor repo)
|
||||||
(sitenav :initarg :sitenav :initform nil :accessor sitenav)
|
(sitenav :initarg :sitenav :accessor sitenav)
|
||||||
(staging :initarg :staging :initform #p"/tmp/coleslaw/" :accessor staging)
|
(staging-dir :initarg :staging-dir :accessor staging-dir)
|
||||||
(title :initarg :title :initform "" :accessor title)
|
(title :initarg :title :accessor title)
|
||||||
(theme :initarg :theme :initform "hyde" :accessor theme)))
|
(theme :initarg :theme :accessor theme)))
|
||||||
|
|
||||||
(define-condition unknown-config-section-error (error)
|
(define-condition unknown-config-section-error (error)
|
||||||
((text :initarg :text :reader text)))
|
((text :initarg :text :reader text)))
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
|
|
||||||
(defun make-tag (str)
|
(defun make-tag (str)
|
||||||
"Takes a string and returns a TAG instance with a name and slug."
|
"Takes a string and returns a TAG instance with a name and slug."
|
||||||
(make-instance 'tag :name (string-trim " " str) :slug (slugify str)))
|
(let ((trimmed (string-trim " " str)))
|
||||||
|
(make-instance 'tag :name trimmed :slug (slugify trimmed))))
|
||||||
|
|
||||||
(defun tag-slug= (a b)
|
(defun tag-slug= (a b)
|
||||||
"Test if the slugs for tag A and B are equal."
|
"Test if the slugs for tag A and B are equal."
|
||||||
|
|
|
@ -18,13 +18,13 @@
|
||||||
(defclass int-index (index) ())
|
(defclass int-index (index) ())
|
||||||
|
|
||||||
(defmethod page-path ((object index))
|
(defmethod page-path ((object index))
|
||||||
(rel-path (staging *config*) (index-id object)))
|
(rel-path (staging-dir *config*) (index-id object)))
|
||||||
(defmethod page-path ((object tag-index))
|
(defmethod page-path ((object tag-index))
|
||||||
(rel-path (staging *config*) "tag/~a" (index-id object)))
|
(rel-path (staging-dir *config*) "tag/~a" (index-id object)))
|
||||||
(defmethod page-path ((object date-index))
|
(defmethod page-path ((object date-index))
|
||||||
(rel-path (staging *config*) "date/~a" (index-id object)))
|
(rel-path (staging-dir *config*) "date/~a" (index-id object)))
|
||||||
(defmethod page-path ((object int-index))
|
(defmethod page-path ((object int-index))
|
||||||
(rel-path (staging *config*) "~d" (index-id object)))
|
(rel-path (staging-dir *config*) "~d" (index-id object)))
|
||||||
|
|
||||||
(defun all-months ()
|
(defun all-months ()
|
||||||
"Retrieve a list of all months with published content."
|
"Retrieve a list of all months with published content."
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
:next next)))
|
:next next)))
|
||||||
|
|
||||||
(defmethod page-path ((object post))
|
(defmethod page-path ((object post))
|
||||||
(rel-path (staging *config*) "posts/~a" (content-slug object)))
|
(rel-path (staging-dir *config*) "posts/~a" (content-slug object)))
|
||||||
|
|
||||||
(defmethod initialize-instance :after ((object post) &key)
|
(defmethod initialize-instance :after ((object post) &key)
|
||||||
(with-accessors ((title post-title)
|
(with-accessors ((title post-title)
|
||||||
|
|
Loading…
Add table
Reference in a new issue