kyra/mod/post.tengo

27 lines
348 B
Text
Raw Permalink Normal View History

2024-06-09 15:16:38 +03:00
fmt := import("fmt")
paths := import("paths")
htmExt := func(c){
if c.is_compo {
return
}
c.pp.print(`</body></html>`)
}
exts := {
".htm": htmExt,
".html": htmExt
}
export func(c){
ext := paths.ext(c.pp.filepath)
ext = paths.ext(
c.pp.filepath[:len(c.pp.filepath) - len(ext)]
)
cl := exts[ext]
if !is_undefined(cl) {
cl(c)
}
}