From 30731133aff475f100cea7fac18017505a400c38 Mon Sep 17 00:00:00 2001 From: bdunahu Date: Fri, 21 Aug 2026 20:54:39 -0400 Subject: Move contact, blog to index. Rewrite index, structural changes. --- src/operationnull/theme.scm | 69 +++++++++++++++++++++------------------------ 1 file changed, 32 insertions(+), 37 deletions(-) (limited to 'src/operationnull/theme.scm') diff --git a/src/operationnull/theme.scm b/src/operationnull/theme.scm index 752b9c2..806faec 100644 --- a/src/operationnull/theme.scm +++ b/src/operationnull/theme.scm @@ -8,7 +8,9 @@ #:use-module (haunt site) #:use-module (ice-9 match) #:use-module (srfi srfi-19) - #:export (main-theme)) + #:use-module (operationnull utils) + #:export (main-theme + base-template)) (define %cc-by-sa-link '(a (@ (href "https://creativecommons.org/licenses/by-sa/4.0/")) @@ -21,11 +23,7 @@ (div (@ (class "intro-main")) (div (@ (class "intro-left")) (nav - (div (ul (li (a (@ (href "/contact.html")) - "contact")) - (li (a (@ (href "/posts/")) - "blog")) - (li (a (@ (href "https://git.operationnull.com/")) + (div (ul (li (a (@ (href "https://git.operationnull.com/")) "git")) (li (a (@ (href "https://codeberg.org/bdunahu")) "codeberg")) @@ -72,34 +70,35 @@ `(link (@ (rel "stylesheet") (href ,(string-append "/assets/" name ".css"))))) +(define (base-template site title body) + `((doctype "html") + (head + (meta (@ (http-equiv "Content-Type") (content "text/html; charset=UTF-8"))) + (meta (@ (http-equiv "Content-Language") (content "en"))) + (meta (@ (name "viewport") + (content "width=device-width, initial-scale=1"))) + (meta (@ (name "description") + (content "bdunahu's personal website"))) + (meta (@ (name "author") (content "bdunahu"))) + ;; (link (@ (rel "icon") + ;; (type "image/x-icon") + ;; (href "/assets/favicon.ico"))) + (title ,(string-append title " — " (site-title site))) + ,(stylesheet "site") + ,(stylesheet "xtra")) + ,%intro + (body + (div (@ (class "container")) + ,body)) + ,%footer)) + (define main-theme (theme #:name "bdunahu" - #:layout - (lambda (site title body) - `((doctype "html") - (head - (meta (@ (http-equiv "Content-Type") (content "text/html; charset=UTF-8"))) - (meta (@ (http-equiv "Content-Language") (content "en"))) - (meta (@ (name "viewport") - (content "width=device-width, initial-scale=1"))) - (meta (@ (name "description") - (content "bdunahu's personal website"))) - (meta (@ (name "author") (content "bdunahu"))) - ;; (link (@ (rel "icon") - ;; (type "image/x-icon") - ;; (href "/assets/favicon.ico"))) - (title ,(string-append title " — " (site-title site))) - ,(stylesheet "site") - ,(stylesheet "xtra")) - ,%intro - (body - (div (@ (class "container")) - ,body)) - ,%footer)) + #:layout base-template #:post-template (lambda (post) `((article - (h3 (@ (class "title")),(post-ref post 'title)) + (h1 (@ (class "title")),(post-ref post 'title)) (div (@ (class "date")) ,(date->string (post-date post) "created: ~B ~d, ~Y")) @@ -114,23 +113,19 @@ ,(post-sxml post))))) #:collection-template (lambda (site title posts prefix) - (define (post-uri post) - (string-append prefix "/" (site-post-slug site post) ".html")) - - `(article (h2 ,title + `(article (h1 ,title (a (@ (href "/atom.xml")) (img (@ (class "feed-icon") (src "/assets/feed.png"))))) ,(map (lambda (post) - (let ((uri (post-uri post))) - `(article (@ (class "summary")) + (let ((uri (post-uri site post))) + `(div (@ (class "summary")) (h3 (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)) "more...")))) + ,(first-paragraph post))))) posts))) #:pagination-template (lambda (site body previous-page next-page) -- cgit v1.2.3