summaryrefslogtreecommitdiffstats
path: root/hugolib/taxonomy.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-11-13 14:27:10 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2016-11-22 09:57:03 +0100
commitc8d3124ddeb86093caf1b18dfaa328c3053e5b63 (patch)
tree70ff5902eb6ceb5e27202c21b9189e18ee3ea8cb /hugolib/taxonomy.go
parent9347084d61a91c73bba1e04790b029163c38bacf (diff)
node to page: Remove Node
And misc. TODO-fixes Updates #2297
Diffstat (limited to 'hugolib/taxonomy.go')
-rw-r--r--hugolib/taxonomy.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/hugolib/taxonomy.go b/hugolib/taxonomy.go
index 112d22b37..68354de89 100644
--- a/hugolib/taxonomy.go
+++ b/hugolib/taxonomy.go
@@ -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