aboutsummaryrefslogtreecommitdiffstats
path: root/main.go
diff options
context:
space:
mode:
authorEddy Pedroni <eddy@0xf7.com>2020-02-01 11:06:24 +0100
committerEddy Pedroni <eddy@0xf7.com>2020-02-01 11:08:12 +0100
commit4bedcc88d171a0886a114c604a79155d088bdbeb (patch)
tree1d6b24ebd61e55371dbc8a1e0f862eae0efc3099 /main.go
parent5ec92205b871ede6ae4b8afc755efb7d06d1ffd9 (diff)
Fixed URL generation, added nav list generation, added page generation
stub
Diffstat (limited to 'main.go')
-rw-r--r--main.go24
1 files changed, 10 insertions, 14 deletions
diff --git a/main.go b/main.go
index cab9fcc..ad5e819 100644
--- a/main.go
+++ b/main.go
@@ -5,11 +5,6 @@ import (
"os"
)
-type templateData struct {
- SiteTitle string
- Pages map[string]page
- Index int
-}
func main() {
// show usage if config file is missing
@@ -31,14 +26,15 @@ func main() {
}
// render all entries
- var pages = make(map[string]page)
- for _, e := range entries {
- fmt.Println("Processing page")
- e.render(pages)
- fmt.Println(pages)
- fmt.Println("**************")
-
- }
- fmt.Println("----------------------------------------------------------------------------------------------")
+ pages := createPageMap(entries)
+ fmt.Println("Pages:")
fmt.Println(pages)
+
+ // create navigation item slice
+ navItems := createNavSlice(pages, cfg)
+ fmt.Println("Navigation:")
+ fmt.Println(navItems)
+
+ generatePages(pages, navItems, cfg)
+
}