aboutsummaryrefslogtreecommitdiff
path: root/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'main.go')
-rw-r--r--main.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/main.go b/main.go
index 57ef485..cd23aea 100644
--- a/main.go
+++ b/main.go
@@ -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)
}