mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-22 21:42:50 +02:00
@@ -63,8 +63,14 @@ func kp(in string) string {
|
|||||||
return helpers.MakePathSanitized(in)
|
return helpers.MakePathSanitized(in)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (i Taxonomy) Get(key string) WeightedPages { return i[kp(key)] }
|
func (i Taxonomy) Get(key string) WeightedPages {
|
||||||
func (i Taxonomy) Count(key string) int { return len(i[kp(key)]) }
|
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) {
|
func (i Taxonomy) Add(key string, w WeightedPage, pretty bool) {
|
||||||
if !pretty {
|
if !pretty {
|
||||||
key = kp(key)
|
key = kp(key)
|
||||||
|
Reference in New Issue
Block a user