1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- fmt := import("fmt")
- paths := import("paths")
- html := import("html").Renderer()
- ht := import("./htm")
- htmExt := func(c){
- if c.is_compo {
- return
- }
- c.pp.print(`<!doctype html><html>`)
- 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(`<body>`)
- if c.no_header {
- } else{
- ht.print_header(c)
- }
- if c.not_main {
- } else {
- c.pp.print("<main id=\"main\">")
- }
- }
- exts := {
- ".htm": htmExt,
- ".html": htmExt
- }
- export func(c){
- ext := c.fext
- cl := exts[ext]
- if cl {
- cl(c)
- }
- }
|