diff --git a/main.go b/main.go index 7905807..eb55d06 100644 --- a/main.go +++ b/main.go @@ -1,5 +1,21 @@ package main -func main() { +import ( + "embed" + "github.com/anhgelus/golatt" +) +//go:embed templates +var templates embed.FS + +func main() { + g := golatt.New(templates) + g.DefaultSeoData = &golatt.SeoData{ + Image: "", + Description: "", + Domain: "now.anhgelus.world", + } + g.Templates = append(g.Templates, "templates/page/*.gohtml") + + g.StartServer(":80") } diff --git a/templates/page/base.gohtml b/templates/page/base.gohtml new file mode 100644 index 0000000..2de2ba4 --- /dev/null +++ b/templates/page/base.gohtml @@ -0,0 +1,23 @@ +{{define "base"}} + + + + + + + {{ .Title }} + + {{template "opengraph-base" .SEO}} + + + {{if .Data.HasNav}} + {{template "navbar" .}} + {{end}} + {{template "body" .}} + {{if .Data.HasFooter}} + {{template "footer" .}} + {{end}} + + + +{{end}} \ No newline at end of file diff --git a/templates/page/opengraph.gohtml b/templates/page/opengraph.gohtml new file mode 100644 index 0000000..f51d561 --- /dev/null +++ b/templates/page/opengraph.gohtml @@ -0,0 +1,18 @@ +{{define "opengraph-base"}} + + + + + + + + + + + + + + + + +{{end}}