fmt := import("fmt") paths := import("paths") html := import("html").Renderer() ht := import("./htm") htmExt := func(c){ if c.is_compo { return } c.pp.print(``) head := html.head() if c.title { head.add(html.title().body("SRPG-WIKI - " + string(c.title))) } for _, script in c.scripts { head.add(html.script({ src: script })) } head.add( html.link({ rel: "stylesheet", href: "/web/main.css" }).final(), html.script({ //src: `https://unpkg.com/htmx.org@1.9.2` src: "/web/script/main.js" }), html.meta({ content: "width=device-width,initial-scale=1", name: "viewport" }).final() ) c.pp.print(head) c.pp.print(``) if c.no_header { } else{ ht.print_header(c) } if c.not_main { } else { c.pp.print("
") } } exts := { ".htm": htmExt, ".html": htmExt } export func(c){ ext := c.fext cl := exts[ext] if cl { cl(c) } }