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