Complete refactor of indexes, move (and rewrite) page sorting to page.go, add tests

This commit is contained in:
spf13
2013-12-20 09:10:05 -05:00
parent 6aa3e51228
commit 70745e8cb5
4 changed files with 229 additions and 147 deletions

View File

@@ -315,7 +315,7 @@ func (s *Site) BuildSiteMeta() (err error) {
v, ok := vals.([]string)
if ok {
for _, idx := range v {
x := WeightedIndexEntry{weight.(int), p}
x := WeightedPage{weight.(int), p}
s.Indexes[plural].Add(idx, x)
}
@@ -332,7 +332,7 @@ func (s *Site) BuildSiteMeta() (err error) {
}
for i, p := range s.Pages {
s.Sections.Add(p.Section, WeightedIndexEntry{s.Pages[i].Weight, s.Pages[i]})
s.Sections.Add(p.Section, WeightedPage{s.Pages[i].Weight, s.Pages[i]})
}
for k := range s.Sections {