Make RSS and ATOM templates theme-agnostic.

This commit is contained in:
Brit Butler 2012-09-12 12:52:36 -04:00
parent f1ea9e89ae
commit 26b7e1b866
4 changed files with 11 additions and 8 deletions

View file

@ -57,6 +57,6 @@ Additional args to render CONTENT can be passed via RENDER-ARGS."
(defun main () (defun main ()
"Load the user's config, then compile and deploy the blog." "Load the user's config, then compile and deploy the blog."
(load-config) (load-config)
(compile-theme) (compile-theme (theme *config*))
(compile-blog (staging *config*)) (compile-blog (staging *config*))
(deploy (staging *config*))) (deploy (staging *config*)))

View file

@ -16,15 +16,18 @@
"Find the symbol NAME inside the current theme's package." "Find the symbol NAME inside the current theme's package."
(find-symbol (princ-to-string name) (theme-package))) (find-symbol (princ-to-string name) (theme-package)))
(defun compile-theme (&key (theme-dir (app-path "themes/~a/" (theme *config*)))) (defun compile-theme (theme)
"Iterate over the files in THEME-DIR, compiling them when they are templates." "Locate and compile the templates for the given THEME."
(do-files (file theme-dir "tmpl") (do-files (file (app-path "themes/~a/" theme) "tmpl")
(compile-template :common-lisp-backend file))
(do-files (file (app-path "themes/") "tmpl")
(compile-template :common-lisp-backend file))) (compile-template :common-lisp-backend file)))
;; DOCUMENTATION ;; DOCUMENTATION
;; A theme directory should be named after the theme and contain *.tmpl files ;; A theme directory should be named after the theme and contain *.tmpl files
;; that define the following functions in a coleslaw.theme.$NAME namespace. ;; that define the following functions in a coleslaw.theme.$NAME namespace.
;; Required templates follow with suggested args (args will be in plists): ;; Required templates:
;; {template base} // title navigation siteroot content credits &key license headInject bodyInject ;; {template base}
;; {template post} // title tags date content prev next &key comments ;; {template post}
;; {template index} // title posts prev next &key taglinks monthlinks count ;; {template index}