kyra/mod/post.tengo
2024-06-09 17:16:38 +05:00

26 lines
348 B
Text

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)
}
}