Enable THEME-FN to take a symbol, keyword, or string. Update call sites.
This commit is contained in:
parent
870e8d04e8
commit
af0ee8c411
5 changed files with 5 additions and 5 deletions
|
@ -8,7 +8,7 @@ If RAW is non-nil, write the content without wrapping it in the base template."
|
||||||
(with-open-file (out filepath
|
(with-open-file (out filepath
|
||||||
:direction :output
|
:direction :output
|
||||||
:if-does-not-exist :create)
|
:if-does-not-exist :create)
|
||||||
(let ((content (funcall (theme-fn "BASE")
|
(let ((content (funcall (theme-fn 'base)
|
||||||
(list :title (title *config*)
|
(list :title (title *config*)
|
||||||
:siteroot (domain *config*)
|
:siteroot (domain *config*)
|
||||||
:navigation (sitenav *config*)
|
:navigation (sitenav *config*)
|
||||||
|
|
|
@ -25,7 +25,7 @@
|
||||||
:tags (post-tags post)
|
:tags (post-tags post)
|
||||||
:content (post-content post)))))
|
:content (post-content post)))))
|
||||||
(render-page "rss.xml"
|
(render-page "rss.xml"
|
||||||
(funcall (theme-fn "RSS")
|
(funcall (theme-fn 'rss)
|
||||||
(list :pubdate (make-pubdate)
|
(list :pubdate (make-pubdate)
|
||||||
:title (title *config*)
|
:title (title *config*)
|
||||||
:siteroot (domain *config*)
|
:siteroot (domain *config*)
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
:content (render-content (post-content post)
|
:content (render-content (post-content post)
|
||||||
(post-format post))))))
|
(post-format post))))))
|
||||||
(render-page filename
|
(render-page filename
|
||||||
(funcall (theme-fn "INDEX")
|
(funcall (theme-fn 'index)
|
||||||
(list :taglinks (taglinks)
|
(list :taglinks (taglinks)
|
||||||
:monthlinks (monthlinks)
|
:monthlinks (monthlinks)
|
||||||
:siteroot (domain *config*)
|
:siteroot (domain *config*)
|
||||||
|
|
|
@ -76,7 +76,7 @@
|
||||||
(defun write-post (post &key prev next)
|
(defun write-post (post &key prev next)
|
||||||
"Write out the HTML for POST in SLUG.html."
|
"Write out the HTML for POST in SLUG.html."
|
||||||
(render-page (format nil "posts/~a" (post-url post))
|
(render-page (format nil "posts/~a" (post-url post))
|
||||||
(funcall (theme-fn "POST")
|
(funcall (theme-fn 'post)
|
||||||
(list :title (post-title post)
|
(list :title (post-title post)
|
||||||
:tags (taglinks (post-tags post))
|
:tags (taglinks (post-tags post))
|
||||||
:date (post-date post)
|
:date (post-date post)
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
|
|
||||||
(defun theme-fn (name)
|
(defun theme-fn (name)
|
||||||
"Find the symbol NAME inside the current theme's package."
|
"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*))))
|
(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."
|
"Iterate over the files in THEME-DIR, compiling them when they are templates."
|
||||||
|
|
Loading…
Add table
Reference in a new issue