hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 8aa90f2b7e83c748170109eb94169e5222c1755a
parent ccd2f4c32b77c9b722943a96b5d5af99cd7b1712
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Thu,  3 Mar 2016 22:01:09 +0100

Try both prepped and unprepped taxonomy keys

Fixes #1869

Diffstat:
Mhugolib/taxonomy.go | 10++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git 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)