88 lines
4.1 KiB
Scheme
88 lines
4.1 KiB
Scheme
(use-modules (haunt asset)
|
||
(haunt builder blog)
|
||
(haunt builder atom)
|
||
(haunt builder assets)
|
||
(haunt builder rss)
|
||
(haunt builder flat-pages)
|
||
(haunt post)
|
||
(haunt publisher rsync)
|
||
(haunt reader)
|
||
(haunt site)
|
||
(srfi srfi-19))
|
||
|
||
(define (my-layout site title sxml)
|
||
`((doctype HTML)
|
||
(html
|
||
(@ (lang "en"))
|
||
(head
|
||
(meta (@ (http-equiv "Content-Type") (content "text/html; charset=utf-8")))
|
||
(meta (@ (http-equiv "Content-Security-Policy") (content "default-src 'self';")))
|
||
(meta (@ (name "viewport") (content "width=device-width, initial-scale=1.0")))
|
||
(meta (@ (name "description") (content ,(site-title site))))
|
||
(meta (@ (name "color-scheme") (content "light dark")))
|
||
(link (@ (href "/~afiw/assets/style.css") (rel "stylesheet") (type "text/css")))
|
||
(link (@ (href "/~afiw/assets/favicon.ico") (rel "icon") (type "image/x-icon")))
|
||
(link (@ (href "/~afiw/assets/favicon.png") (rel "icon") (type "image/png")))
|
||
(link (@ (href "/~afiw/assets/favicon.gif") (rel "icon") (type "image/gif")))
|
||
(link (@ (href "/~afiw/feed.xml") (rel "alternate") (type "application/atom+xml")))
|
||
(link (@ (href "/~afiw/rss-feed.xml") (rel "alternate") (type "application/rss+xml")))
|
||
(title ,(format #f "~a – afiw" title)))
|
||
(body
|
||
(header
|
||
(strong ,(site-title site))
|
||
(nav
|
||
(ul
|
||
(li (a (@ (href "/~afiw")) "about"))
|
||
(li (a (@ (href "/~afiw/contact")) "contact"))
|
||
(li (a (@ (href "/~afiw/posts")) "posts"))
|
||
(li (a (@ (href "/~afiw/projects")) "projects"))
|
||
(li (a (@ (href "/")) "tilde")))))
|
||
(main
|
||
(article
|
||
(h1 ,title)
|
||
,sxml))
|
||
(footer
|
||
(small
|
||
"made with " (a (@ (href "https://dthompson.us/projects/haunt.html")) "haunt") " • "
|
||
"copyleft " ,(integer->char #x1f12f) " afiw 2026, all rights reversed • cc-by-sa-4.0 • "
|
||
(a (@ (href "https://git.linuxposting.xyz/afiw/webbedsite")) "source")))))))
|
||
|
||
(define my-theme
|
||
(theme #:name "em's theme"
|
||
#:layout my-layout
|
||
#:post-template (lambda (post)
|
||
`((h3 ,(date->string (post-date post) "~1"))
|
||
,(post-sxml post)))
|
||
#:collection-template (lambda (site title posts prefix)
|
||
`((ul
|
||
,@(map (lambda (post)
|
||
`(li
|
||
(a (@ (href ,(string-append "/~afiw/"
|
||
(or prefix "")
|
||
"/"
|
||
(site-post-slug site post)
|
||
".html")))
|
||
,(post-ref post 'title)
|
||
" – "
|
||
,(date->string (post-date post) "~1"))))
|
||
posts))))))
|
||
|
||
(site #:title "afiw's webbed site"
|
||
#:domain "tilde.linuxposting.xyz"
|
||
#:default-metadata
|
||
'((author . "afiw")
|
||
(email . "afiw@linuxposting.xyz"))
|
||
#:readers (list sxml-reader)
|
||
#:build-directory "out"
|
||
#:builders (list (blog #:prefix "posts"
|
||
#:theme my-theme
|
||
#:collections `(("posts" "posts/index.html"
|
||
,posts/reverse-chronological)))
|
||
(atom-feed)
|
||
(atom-feeds-by-tag)
|
||
(rss-feed)
|
||
(static-directory "assets")
|
||
(static-directory "dist")
|
||
(flat-pages "static" #:template my-layout))
|
||
#:publishers (list (rsync-publisher #:name 'tilde
|
||
#:destination "afiw@tilde.linuxposting.xyz:public")))
|