This commit is contained in:
xenia 2021-06-10 19:45:14 -04:00
parent 50ca84d515
commit fe87941b51
2 changed files with 5 additions and 2 deletions

View File

@ -9,6 +9,7 @@
(list/c 'date integer? integer? integer?) (list/c 'date integer? integer? integer?)
(list/c 'title string?) (list/c 'title string?)
(list/c 'slug string?) (list/c 'slug string?)
(list/c 'lang string?)
(cons/c 'tags (listof string?)) (cons/c 'tags (listof string?))
(list/c 'summary string?) (list/c 'summary string?)
(cons/c 'authors (listof string?))))) (cons/c 'authors (listof string?)))))
@ -19,4 +20,6 @@
[(cons _ rst) rst])) [(cons _ rst) rst]))
(define (metadata-ref+ md key [default (λ () (error "no such key"))]) (define (metadata-ref+ md key [default (λ () (error "no such key"))])
(first (metadata-ref md key default))) (match (assoc key md)
[#f (if (procedure? default) (default) default)]
[(list _ snd) snd]))

View File

@ -1,7 +1,7 @@
#lang s-exp "../xtemplate.rkt" #lang s-exp "../xtemplate.rkt"
`(html `(html
([lang "en"]) ([lang ,(metadata-ref+ metadata 'lang "en")])
(head (head
() ()
(!HTML-COMMENT () " this page made with: trans rights 🏳️‍⚧️ ") (!HTML-COMMENT () " this page made with: trans rights 🏳️‍⚧️ ")