diff options
author | Eddy Pedroni <eddy@0xf7.com> | 2020-02-01 17:33:04 +0100 |
---|---|---|
committer | Eddy Pedroni <eddy@0xf7.com> | 2020-02-01 17:33:04 +0100 |
commit | ace49dc8ef6eb5236eed364f885ff6ed76554188 (patch) | |
tree | cf6fb1fe6b32ce18d1637bc0ef7a9a48c9710f95 | |
parent | a34c18ba4135b14dc6d3502f194b3a1bbc89aae1 (diff) |
Added homepage generation
-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 } |