move webserver files to ./web/
This commit is contained in:
43
src/web/html/layout.go
Normal file
43
src/web/html/layout.go
Normal file
@@ -0,0 +1,43 @@
|
||||
package html
|
||||
|
||||
import (
|
||||
g "maragu.dev/gomponents"
|
||||
c "maragu.dev/gomponents/components"
|
||||
h "maragu.dev/gomponents/html"
|
||||
)
|
||||
|
||||
func Layout(title string, body g.Node) g.Node {
|
||||
completeBody := []g.Node{
|
||||
Navbar(),
|
||||
h.Div(
|
||||
h.Class("content container flex flex-col mx-auto px-4 mt-28"),
|
||||
body,
|
||||
),
|
||||
h.Script(h.Src("https://cdn.tailwindcss.com")),
|
||||
h.Script(
|
||||
g.Text(
|
||||
"up.link.config.followSelectors.push('a[href]')\n" +
|
||||
"up.link.config.instantSelectors.push('a[href]')",
|
||||
),
|
||||
),
|
||||
}
|
||||
|
||||
return c.HTML5(c.HTML5Props{
|
||||
Title: title,
|
||||
Language: "de",
|
||||
Head: layoutHead(),
|
||||
Body: completeBody,
|
||||
HTMLAttrs: []g.Node{g.Attr("data-theme", "dark")},
|
||||
})
|
||||
}
|
||||
|
||||
func layoutHead() []g.Node {
|
||||
return []g.Node{
|
||||
h.Meta(h.Name("viewport"), h.Content("width=device-width, initial-scale=1")),
|
||||
h.Link(h.Rel("stylesheet"), h.Type("text/css"), h.Href("/static/unpoly.min.css")),
|
||||
h.Script(h.Src("/static/unpoly.min.js")),
|
||||
h.Link(h.Rel("stylesheet"), h.Type("text/css"), h.Href("/static/daisyui.min.css")),
|
||||
h.Script(h.Src("/static/tailwindcss.min.js")),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user