(define-module (theme) #:use-module (haunt artifact) #:use-module (haunt asset) #:use-module (haunt builder blog) #:use-module (haunt html) #:use-module (haunt post) #:use-module (haunt site) #:use-module (srfi srfi-19) #:export (vin-theme)) (define (link name uri) `(a (@ (href ,uri)) ,name)) (define vin-theme (theme #:name "vin" #:layout (lambda (site title body) `((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") (title "Atom feed") (href "/feed.xml"))) (link (@ (rel "icon") (type "image/png") (href "/static/AT_terminus.png"))) (link (@ (rel "stylesheet") (type "text/css") (href "/static/main.css"))) (body (div (@ (class "container")) (nav (ul (li ,(link "Vineet K" "/"))) (ul (li ,(link "About Me" "/about.html")) (li ,(link "Blog" "/index.html")) ;; (li ,(link "Projects" "/projects.html")) )) ,body (footer (@ (class "text-center")) (p "The content for the site is under the " ,(link "CC-BY-NC-SA-4.0 License" "/static/cc-by-nc-sa-4.0.txt") ". " "The code for this site is under the " ,(link "GNU AGPLv3 License" "/static/agpl-3.0.txt") "."))))))) #:post-template (lambda (post) `((article (h1 (@ (class "title")) ,(post-ref post 'title)) (div (@ (class "date")) ,(date->string (post-date post) "~B ~d, ~Y")) (div (@ (class "post")) ,(post-sxml post))))) #:collection-template (lambda (site title posts prefix) (define (post-uri post) (string-append prefix "/" (site-post-slug site post) ".html")) `((h2 ,title " " (a (@ (href "/feed.xml")) "(feed)")) ,(map (lambda (post) (let ((uri (post-uri post))) `(div (@ (class "posts")) (div (@ (class "post")) (span (span (@ (class "date")) ,(date->string (post-date post) "~Y-~m-~d")) " - " (a (@ (href ,uri)) ,(post-ref post 'title))))))) posts)))))