This commit is contained in:
Swrup 2022-12-04 22:42:55 +01:00
commit 6fd066773f
37 changed files with 1537 additions and 0 deletions

15
src/template.ml Normal file
View file

@ -0,0 +1,15 @@
open Tyxml
let render ~page_title ~scripts content =
let open Html in
let head =
head
(title (txt page_title))
( [ link ~rel:[ `Icon ] ~href:"/assets/img/favicon.png" ()
; link ~rel:[ `Stylesheet ] ~href:"/assets/css/style.css" ()
]
@ scripts )
in
let body = body [ main [ content ] ] in
let page = html head body in
Format.asprintf "%a@." (pp ~indent:true ()) page