add lang
This commit is contained in:
parent
50ca84d515
commit
fe87941b51
5
defs.rkt
5
defs.rkt
|
@ -9,6 +9,7 @@
|
|||
(list/c 'date integer? integer? integer?)
|
||||
(list/c 'title string?)
|
||||
(list/c 'slug string?)
|
||||
(list/c 'lang string?)
|
||||
(cons/c 'tags (listof string?))
|
||||
(list/c 'summary string?)
|
||||
(cons/c 'authors (listof string?)))))
|
||||
|
@ -19,4 +20,6 @@
|
|||
[(cons _ rst) rst]))
|
||||
|
||||
(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]))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#lang s-exp "../xtemplate.rkt"
|
||||
|
||||
`(html
|
||||
([lang "en"])
|
||||
([lang ,(metadata-ref+ metadata 'lang "en")])
|
||||
(head
|
||||
()
|
||||
(!HTML-COMMENT () " this page made with: trans rights 🏳️⚧️ ")
|
||||
|
|
Loading…
Reference in New Issue