12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- fmt := import("fmt")
- paths := import("paths")
- html := import("html").Renderer()
- dnd5 := import("dnd5")
- 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){
- c.dnd5 = dnd5(c)
- ext := c.fext
- cl := exts[ext]
- if cl {
- cl(c)
- }
- }
|