pellest/src/template.ml

16 lines
417 B
OCaml
Raw Normal View History

2022-12-04 22:42:55 +01:00
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