capybara/templates/page.html.rkt

48 lines
1.8 KiB
Racket

#lang capybara/template
`(html
([lang ,(assoc-ref+ metadata 'lang "en")])
(head
()
(!HTML-COMMENT () " this page made with: trans rights 🏳️‍⚧️ ")
(meta ([charset "utf-8"]))
(title () ,(assoc-ref+ metadata 'title "<untitled page>"))
(meta ([name "viewport"] [content "width=device-width, initial-scale=1"]))
,@(match (assoc-ref+ metadata 'summary #f)
[#f '()]
[summary
`((meta ([name "description"] [content ,summary])))])
,@(match (assoc-ref metadata 'authors #f)
[(or #f '()) '()]
[authors
`((meta ([name "author"] [content ,(string-join authors ", ")])))])
,@(match (assoc-ref metadata 'date #f)
[#f '()]
[(list yn mn dn)
`((meta ([name "DC.Date.created"]
[content ,(format "~a-~a-~a" (~r/pad yn 4) (~r/pad mn 2) (~r/pad dn 2))])))])
(meta ([name "generator"]
[content
,(format "capybara ~a https://git.lain.faith/haskal/capybara" capybara-version)]))
(link ([rel "shortcut icon"] [type "image/png"] [href ,(format "~a/favicon.png" base-url)]))
(link ([rel "stylesheet"] [type "text/css"] [href ,(format "~a/index.css" base-url)])))
(body
()
(nav
()
(section () ,site-toc)
,@(if content-toc `((section () ,content-toc)) '()))
(main
()
,@(match (assoc-ref metadata 'tags '())
['() '()]
[tags
`((p ()
"tags:"
,@(for/list ([tag (in-list tags)])
`(span ([class "page-tag"]) ,(format "#~a" tag)))))])
,@content)
;; mathjax polyfill script sentinel -- gets replaced by a script tag for crying doge chrombe
;; and with nothing for swole firefox
(div ([style "display: none"]) "__X_MATHJAX_POLYFILL_PLACEHOLDER__")))