Enable THEME-FN to take a symbol, keyword, or string. Update call sites.

This commit is contained in:
Brit Butler 2012-08-29 23:08:48 -04:00
parent 870e8d04e8
commit af0ee8c411
5 changed files with 5 additions and 5 deletions

View file

@ -8,7 +8,7 @@ If RAW is non-nil, write the content without wrapping it in the base template."
(with-open-file (out filepath
:direction :output
:if-does-not-exist :create)
(let ((content (funcall (theme-fn "BASE")
(let ((content (funcall (theme-fn 'base)
(list :title (title *config*)
:siteroot (domain *config*)
:navigation (sitenav *config*)

View file

@ -25,7 +25,7 @@
:tags (post-tags post)
:content (post-content post)))))
(render-page "rss.xml"
(funcall (theme-fn "RSS")
(funcall (theme-fn 'rss)
(list :pubdate (make-pubdate)
:title (title *config*)
:siteroot (domain *config*)

View file

@ -40,7 +40,7 @@
:content (render-content (post-content post)
(post-format post))))))
(render-page filename
(funcall (theme-fn "INDEX")
(funcall (theme-fn 'index)
(list :taglinks (taglinks)
:monthlinks (monthlinks)
:siteroot (domain *config*)

View file

@ -76,7 +76,7 @@
(defun write-post (post &key prev next)
"Write out the HTML for POST in SLUG.html."
(render-page (format nil "posts/~a" (post-url post))
(funcall (theme-fn "POST")
(funcall (theme-fn 'post)
(list :title (post-title post)
:tags (taglinks (post-tags post))
:date (post-date post)

View file

@ -14,7 +14,7 @@
(defun theme-fn (name)
"Find the symbol NAME inside the current theme's package."
(find-symbol name (theme-package)))
(find-symbol (princ-to-string name) (theme-package)))
(defun compile-theme (&key (theme-dir (app-path "themes/~a/" (theme *config*))))
"Iterate over the files in THEME-DIR, compiling them when they are templates."