diff options
Diffstat (limited to 'theme.scm')
-rw-r--r-- | theme.scm | 73 |
1 files changed, 37 insertions, 36 deletions
@@ -38,14 +38,13 @@ (img (@ (src "https://licensebuttons.net/l/by-sa/4.0/80x15.png"))))) (define (first-paragraph post) - (let loop ((sxml (post-sxml post)) - (result '())) + (let loop ((sxml (post-sxml post))) (match sxml - (() (reverse result)) - ((or (('p ...) _ ...) (paragraph _ ...)) - (reverse (cons paragraph result))) + (() '()) + (((and paragraph ('p . _)) . _) + (list paragraph)) ((head . tail) - (loop tail (cons head result)))))) + (cons head (loop tail)))))) (define dthompson-theme (theme #:name "dthompson" @@ -54,6 +53,8 @@ `((doctype "html") (head (meta (@ (charset "utf-8"))) + (meta (@ (name "viewport") + (content "width=device-width, initial-scale=1"))) (title ,(string-append title " — " (site-title site))) (link (@ (rel "alternate") (type "application/atom+xml") @@ -64,12 +65,11 @@ ,(stylesheet "dthompson")) (body (div (@ (class "container")) - (div (@ (class "nav")) - (ul (li ,(link "David Thompson" "/")) - (li (@ (class "fade-text")) " ") - (li ,(link "About" "/about.html")) - (li ,(link "Blog" "/index.html")) - (li ,(link "Projects" "/projects.html")))) + (nav + (ul (li ,(link "David Thompson" "/"))) + (ul (li ,(link "About" "/about.html")) + (li ,(link "Blog" "/index.html")) + (li ,(link "Projects" "/projects.html")))) ,body (footer (@ (class "text-center")) (p (@ (class "copyright")) @@ -92,19 +92,20 @@ free culture works available under the " ,%cc-by-sa-link " license.") ".")))))) #:post-template (lambda (post) - `((h1 (@ (class "title")),(post-ref post 'title)) - (div (@ (class "date")) - ,(date->string (post-date post) - "~B ~d, ~Y")) - (div (@ (class "tags")) - "Tags:" - (ul ,@(map (lambda (tag) - `(li (a (@ (href ,(string-append "/feeds/tags/" - tag ".xml"))) - ,tag))) - (assq-ref (post-metadata post) 'tags)))) - (div (@ (class "post")) - ,(post-sxml post)))) + `((article + (h1 (@ (class "title")),(post-ref post 'title)) + (div (@ (class "date")) + ,(date->string (post-date post) + "~B ~d, ~Y")) + (div (@ (class "tags")) + "Tags:" + (ul ,@(map (lambda (tag) + `(li (a (@ (href ,(string-append "/feeds/tags/" + tag ".xml"))) + ,tag))) + (assq-ref (post-metadata post) 'tags)))) + (div (@ (class "post")) + ,(post-sxml post))))) #:collection-template (lambda (site title posts prefix) (define (post-uri post) @@ -115,15 +116,15 @@ free culture works available under the " ,%cc-by-sa-link " license.") (img (@ (class "feed-icon") (src "images/feed.png"))))) ,(map (lambda (post) (let ((uri (post-uri post))) - `(div (@ (class "summary")) - (h2 (a (@ (href ,uri)) - ,(post-ref post 'title))) - (div (@ (class "date")) - ,(date->string (post-date post) - "~B ~d, ~Y")) - (div (@ (class "post")) - ,(first-paragraph post)) - (a (@ (href ,uri)) "read more ➔")))) + `(article (@ (class "summary")) + (h2 (a (@ (href ,uri)) + ,(post-ref post 'title))) + (div (@ (class "date")) + ,(date->string (post-date post) + "~B ~d, ~Y")) + (div (@ (class "post")) + ,(first-paragraph post)) + (a (@ (href ,uri)) "read more →")))) posts))) #:pagination-template (lambda (site body previous-page next-page) @@ -131,11 +132,11 @@ free culture works available under the " ,%cc-by-sa-link " license.") (div (@ (class "paginator")) ,(if previous-page `(a (@ (class "paginator-prev") (href ,previous-page)) - "🡐 Newer") + "← Newer") '()) ,(if next-page `(a (@ (class "paginator-next") (href ,next-page)) - "Older 🡒") + "Older →") '())))))) (define (flat-page-template site metadata body) |