diff options
| author | Anhgelus Morhtuuzh <anhgelus@anhgelus.world> | 2024-12-10 19:00:56 +0100 |
|---|---|---|
| committer | Anhgelus Morhtuuzh <anhgelus@anhgelus.world> | 2024-12-10 19:00:56 +0100 |
| commit | 279f73187b9de250de3b1788d1ce543c60832bc6 (patch) | |
| tree | 9302f892044a9b7706d72f7aeade8daef083a473 /main.go | |
| parent | 730ec347582289efbc0cd1c48e4c243d4c4920d6 (diff) | |
feat(custom): config and generation
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -50,6 +50,10 @@ func main() { if err != nil { panic(err) } + customPages, err := cfg.LoadCustomPages() + if err != nil { + panic(err) + } g := golatt.New(templates) g.DefaultSeoData = &golatt.SeoData{ Image: cfg.Image, @@ -74,6 +78,16 @@ func main() { &cfg). Handle() + for _, cp := range customPages { + g.NewTemplate("custom_page", + cp.URI, + cp.Title, + cp.Image, + cp.Description, + cp). + Handle() + } + g.NotFoundHandler = func(w http.ResponseWriter, r *http.Request) { http.Redirect(w, r, "/", http.StatusTemporaryRedirect) } |
