aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEddy Pedroni <eddy@0xf7.com>2020-02-01 17:33:04 +0100
committerEddy Pedroni <eddy@0xf7.com>2020-02-01 17:33:04 +0100
commitace49dc8ef6eb5236eed364f885ff6ed76554188 (patch)
treecf6fb1fe6b32ce18d1637bc0ef7a9a48c9710f95
parenta34c18ba4135b14dc6d3502f194b3a1bbc89aae1 (diff)
Added homepage generation
-rw-r--r--nav.go6
-rw-r--r--page.go4
2 files changed, 8 insertions, 2 deletions
diff --git a/nav.go b/nav.go
index 153a493..c03c90a 100644
--- a/nav.go
+++ b/nav.go
@@ -12,8 +12,10 @@ type navItem struct {
func createNavSlice(site *siteData, cfg config) {
for k, v := range site.pages {
- newNavItem := navItem{AbsoluteUrl: site.baseUrl + "/" + k, Text: v.pageName}
- site.nav = append(site.nav, newNavItem)
+ if k != "" {
+ newNavItem := navItem{AbsoluteUrl: site.baseUrl + "/" + k, Text: v.pageName}
+ site.nav = append(site.nav, newNavItem)
+ }
}
sort.Slice(site.nav, func(i, j int) bool {
diff --git a/page.go b/page.go
index 8bf656a..a88f437 100644
--- a/page.go
+++ b/page.go
@@ -57,5 +57,9 @@ func createPageMap(site *siteData, entries []Renderer) {
}
}
+
+ // create landing page
+ pages[""] = page{pageName: "Home"}
+
site.pages = pages
}