diff options
Diffstat (limited to 'theme.scm')
-rw-r--r-- | theme.scm | 27 |
1 files changed, 14 insertions, 13 deletions
@@ -24,6 +24,7 @@ #:use-module (srfi srfi-19) #:use-module (utils) #:export (dthompson-theme + flat-page-template static-page project-page)) @@ -107,16 +108,13 @@ free culture works available under the " ,%cc-by-sa-link " license.") #:collection-template (lambda (site title posts prefix) (define (post-uri post) - (string-append "/" (or prefix "") - (site-post-slug site post) ".html")) + (string-append prefix "/" (site-post-slug site post) ".html")) `((h1 ,title (a (@ (href "/feed.xml")) (img (@ (class "feed-icon") (src "images/feed.png"))))) ,(map (lambda (post) - (let ((uri (string-append "/" - (site-post-slug site post) - ".html"))) + (let ((uri (post-uri post))) `(div (@ (class "summary")) (h2 (a (@ (href ,uri)) ,(post-ref post 'title))) @@ -131,14 +129,17 @@ free culture works available under the " ,%cc-by-sa-link " license.") (lambda (site body previous-page next-page) `(,@body (div (@ (class "paginator")) - ,(if previous-page - `(a (@ (class "paginator-prev") (href ,previous-page)) - "🡐 Newer") - '()) - ,(if next-page - `(a (@ (class "paginator-next") (href ,next-page)) - "Older 🡒") - '())))))) + ,(if previous-page + `(a (@ (class "paginator-prev") (href ,previous-page)) + "🡐 Newer") + '()) + ,(if next-page + `(a (@ (class "paginator-next") (href ,next-page)) + "Older 🡒") + '())))))) + +(define (flat-page-template site metadata body) + ((theme-layout dthompson-theme) site (assq-ref metadata 'title) body)) (define (static-page title file-name body) (lambda (site posts) |