mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-31 22:41:53 +02:00
@@ -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
|
||||
|
Reference in New Issue
Block a user