node to page: Remove Node

And misc. TODO-fixes

Updates #2297
This commit is contained in:
Bjørn Erik Pedersen
2016-11-13 14:27:10 +01:00
parent 9347084d61
commit c8d3124dde
22 changed files with 538 additions and 567 deletions

View File

@@ -14,6 +14,7 @@
package hugolib
import (
"fmt"
"sort"
"github.com/spf13/hugo/helpers"
@@ -23,6 +24,10 @@ import (
// e.g. List['tags'] => TagTaxonomy (from above)
type TaxonomyList map[string]Taxonomy
func (tl TaxonomyList) String() string {
return fmt.Sprintf("TaxonomyList(%d)", len(tl))
}
// A Taxonomy is a map of keywords to a list of pages.
// For example
// TagTaxonomy['technology'] = WeightedPages
@@ -39,6 +44,10 @@ type WeightedPage struct {
Page *Page
}
func (w WeightedPage) String() string {
return fmt.Sprintf("WeightedPage(%d,%q)", w.Weight, w.Page.Title)
}
// OrderedTaxonomy is another representation of an Taxonomy using an array rather than a map.
// Important because you can't order a map.
type OrderedTaxonomy []OrderedTaxonomyEntry