From af0ee8c4111dd3cef04358b9187267185f5381e1 Mon Sep 17 00:00:00 2001 From: Brit Butler Date: Wed, 29 Aug 2012 23:08:48 -0400 Subject: [PATCH] Enable THEME-FN to take a symbol, keyword, or string. Update call sites. --- src/coleslaw.lisp | 2 +- src/feeds.lisp | 2 +- src/indices.lisp | 2 +- src/posts.lisp | 2 +- src/themes.lisp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/coleslaw.lisp b/src/coleslaw.lisp index f87a1b8..2768fe2 100644 --- a/src/coleslaw.lisp +++ b/src/coleslaw.lisp @@ -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*) diff --git a/src/feeds.lisp b/src/feeds.lisp index c54b53c..3598439 100644 --- a/src/feeds.lisp +++ b/src/feeds.lisp @@ -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*) diff --git a/src/indices.lisp b/src/indices.lisp index 3b9ecf9..91ec562 100644 --- a/src/indices.lisp +++ b/src/indices.lisp @@ -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*) diff --git a/src/posts.lisp b/src/posts.lisp index 96c7730..28bace8 100644 --- a/src/posts.lisp +++ b/src/posts.lisp @@ -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) diff --git a/src/themes.lisp b/src/themes.lisp index 587a123..c48d671 100644 --- a/src/themes.lisp +++ b/src/themes.lisp @@ -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."