mirror of
https://github.com/tiennm99/hugoDocs.git
synced 2026-10-13 14:16:06 +00:00
1 parent
ccd2f4c32b
commit
8aa90f2b7e
1 file changed
+8
-2
+8
-2
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user