mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-21 20:46:30 -05:00
parent
ccd2f4c32b
commit
8aa90f2b7e
1 changed files with 8 additions and 2 deletions
|
@ -63,7 +63,13 @@ 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 {
|
||||||
|
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) 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 {
|
||||||
|
|
Loading…
Reference in a new issue