summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--hugolib/taxonomy.go10
1 files changed, 8 insertions, 2 deletions
diff --git a/hugolib/taxonomy.go b/hugolib/taxonomy.go
index d7ed3f96d..ce96f9ba0 100644
--- a/hugolib/taxonomy.go
+++ b/hugolib/taxonomy.go
@@ -63,8 +63,14 @@ func kp(in string) string {
return helpers.MakePathSanitized(in)
}
-func (i Taxonomy) Get(key string) WeightedPages { return i[kp(key)] }
-func (i Taxonomy) Count(key string) int { return len(i[kp(key)]) }
+func (i Taxonomy) Get(key string) WeightedPages {
+ if val, ok := i[key]; ok {
+ return val
+ }
+ return i[kp(key)]
+}
+
+func (i Taxonomy) Count(key string) int { return len(i[kp(key)]) }
func (i Taxonomy) Add(key string, w WeightedPage, pretty bool) {
if !pretty {
key = kp(key)