diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-01-10 10:55:03 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2017-02-04 11:37:25 +0700 |
commit | c71e1b106e6011d148cac899f83c4685dee33a22 (patch) | |
tree | c5c7090f0c2398c7771e4908ebcc97aa7714ffd2 /hugolib/taxonomy.go | |
parent | 0ada40591216572b0e4c6a8ab986b0aa4fb13c13 (diff) |
all: Refactor to nonglobal file systems
Updates #2701
Fixes #2951
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) } |