SiteInfo is now a pointer on the Node

This commit is contained in:
spf13 2014-05-28 19:11:54 -04:00
parent 7a8b754cad
commit 35a605976e
3 changed files with 5 additions and 5 deletions

View file

@ -20,7 +20,7 @@ import (
type Node struct { type Node struct {
RSSLink template.HTML RSSLink template.HTML
Site SiteInfo Site *SiteInfo
// layout string // layout string
Data map[string]interface{} Data map[string]interface{}
Title string Title string

View file

@ -41,7 +41,7 @@ func TestPermalink(t *testing.T) {
Section: "z", Section: "z",
Url: test.url, Url: test.url,
}, },
Site: SiteInfo{ Site: &SiteInfo{
BaseUrl: test.base, BaseUrl: test.base,
}, },
}, },

View file

@ -330,7 +330,7 @@ func (s *Site) CreatePages() (err error) {
if err != nil { if err != nil {
return err return err
} }
page.Site = s.Info page.Site = &s.Info
page.Tmpl = s.Tmpl page.Tmpl = s.Tmpl
page.Section = file.Section page.Section = file.Section
page.Dir = file.Dir page.Dir = file.Dir
@ -760,7 +760,7 @@ func (s *Site) RenderSitemap() error {
page := &Page{} page := &Page{}
page.Date = s.Info.LastChange page.Date = s.Info.LastChange
page.Site = s.Info page.Site = &s.Info
page.Url = "/" page.Url = "/"
pages = append(pages, page) pages = append(pages, page)
@ -833,7 +833,7 @@ func (s *Site) PrettifyPath(in string) string {
func (s *Site) NewNode() *Node { func (s *Site) NewNode() *Node {
return &Node{ return &Node{
Data: make(map[string]interface{}), Data: make(map[string]interface{}),
Site: s.Info, Site: &s.Info,
} }
} }