package main //import "fmt" /* * This file contains all the code related to turning entries into HTML pages */ type page struct { pageName string content []string } func (p *page) appendContent(c string) { p.content = append(p.content, c) //fmt.Println("---------------------------------------------------------------------------------------------------------") //fmt.Println(p) } type Renderer interface { render(pages map[string]page) (err error) } func (e entry) render(pages map[string]page) (err error) { md, err := processMarkdown(e.fullPath) if err != nil { return } p := page{pageName: e.name, content: []string{md}} pages[e.name] = p return } func (le logEntry) render(pages map[string]page) (err error) { md, err := processMarkdown(le.baseEntry.fullPath) if err != nil { return } if val, ok := pages["log"]; ok { val.appendContent(md) pages["log"] = val } else { p := page{pageName: "Log", content: []string{md}} pages["log"] = p } return }