diff options
Diffstat (limited to 'hugolib/taxonomy.go')
-rw-r--r-- | hugolib/taxonomy.go | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/hugolib/taxonomy.go b/hugolib/taxonomy.go index 68354de89..5faf14d0f 100644 --- a/hugolib/taxonomy.go +++ b/hugolib/taxonomy.go @@ -16,8 +16,6 @@ package hugolib import ( "fmt" "sort" - - "github.com/spf13/hugo/helpers" ) // The TaxonomyList is a list of all taxonomies and their values @@ -59,26 +57,15 @@ type OrderedTaxonomyEntry struct { WeightedPages WeightedPages } -// KeyPrep... Taxonomies should be case insensitive. Can make it easily conditional later. -func kp(in string) string { - return helpers.CurrentPathSpec().MakePathSanitized(in) -} - // Get the weighted pages for the given key. func (i Taxonomy) Get(key string) WeightedPages { - if val, ok := i[key]; ok { - return val - } - return i[kp(key)] + return i[key] } // Count the weighted pages for the given key. -func (i Taxonomy) Count(key string) int { return len(i[kp(key)]) } +func (i Taxonomy) Count(key string) int { return len(i[key]) } -func (i Taxonomy) add(key string, w WeightedPage, pretty bool) { - if !pretty { - key = kp(key) - } +func (i Taxonomy) add(key string, w WeightedPage) { i[key] = append(i[key], w) } |