diff options
-rw-r--r-- | nav.go | 6 | ||||
-rw-r--r-- | page.go | 4 |
2 files changed, 8 insertions, 2 deletions
@@ -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 { @@ -57,5 +57,9 @@ func createPageMap(site *siteData, entries []Renderer) { } } + + // create landing page + pages[""] = page{pageName: "Home"} + site.pages = pages } |