htmgo/templates/starter/pages/root.go

46 lines
1 KiB
Go
Raw Permalink Normal View History

2024-09-23 15:57:59 +00:00
package pages
2024-09-11 00:52:18 +00:00
import (
2024-09-14 00:05:55 +00:00
"github.com/maddalax/htmgo/framework/h"
"starter-template/__htmgo/assets"
2024-09-11 00:52:18 +00:00
)
func RootPage(children ...h.Ren) *h.Page {
2024-10-30 18:40:49 +00:00
title := "htmgo template"
description := "an example of the htmgo template"
author := "htmgo"
url := "https://htmgo.dev"
return h.NewPage(
h.Html(
h.HxExtensions(
h.BaseExtensions(),
),
h.Head(
2024-10-30 18:40:49 +00:00
h.Title(
h.Text(title),
),
h.Meta("viewport", "width=device-width, initial-scale=1"),
h.Link(assets.FaviconIco, "icon"),
h.Link(assets.AppleTouchIconPng, "apple-touch-icon"),
2024-10-30 18:40:49 +00:00
h.Meta("title", title),
h.Meta("charset", "utf-8"),
2024-10-30 18:40:49 +00:00
h.Meta("author", author),
h.Meta("description", description),
h.Meta("og:title", title),
h.Meta("og:url", url),
h.Link("canonical", url),
h.Meta("og:description", description),
h.Link(assets.MainCss, "stylesheet"),
h.Script(assets.HtmgoJs),
),
h.Body(
h.Div(
h.Class("flex flex-col gap-2 bg-white h-full"),
h.Fragment(children...),
),
2024-09-11 00:52:18 +00:00
),
),
)
}