kyra/mod/pre.xgo

37 lines
506 B
Text
Raw Permalink Normal View History

2024-06-09 15:16:38 +03:00
paths := import("paths")
2024-08-02 18:30:32 +03:00
html := import("html").Renderer()
2024-06-09 15:16:38 +03:00
htmExt := func(c){
if c.is_compo {
return
}
c.pp.print(`<!doctype html><html>`)
c.pp.print(html.head().body(
func(){
if c.title {
return html.title().body(c.title)
}
}(),
html.script({
src: `https://unpkg.com/htmx.org@1.9.2`
})
))
c.pp.print(`<body>`)
2024-08-02 18:30:32 +03:00
c.pp.print(html.div().body(c.global.val))
2024-06-09 15:16:38 +03:00
}
exts := {
".htm": htmExt,
".html": htmExt
}
export func(c){
2024-08-02 18:30:32 +03:00
ext := c.fext
2024-06-09 15:16:38 +03:00
cl := exts[ext]
if cl {
cl(c)
}
}