mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Taxonomies can now be provided as a single string value if there is only one in frontmatter (tag = "val" vs tag = ["val"])
This commit is contained in:
@@ -535,13 +535,14 @@ func (s *Site) assembleTaxonomies() {
|
||||
}
|
||||
|
||||
if vals != nil {
|
||||
v, ok := vals.([]string)
|
||||
if ok {
|
||||
if v, ok := vals.([]string); ok {
|
||||
for _, idx := range v {
|
||||
x := WeightedPage{weight.(int), p}
|
||||
|
||||
s.Taxonomies[plural].Add(idx, x)
|
||||
}
|
||||
} else if v, ok := vals.(string); ok {
|
||||
x := WeightedPage{weight.(int), p}
|
||||
s.Taxonomies[plural].Add(v, x)
|
||||
} else {
|
||||
jww.ERROR.Printf("Invalid %s in %s\n", plural, p.File.FileName)
|
||||
}
|
||||
|
Reference in New Issue
Block a user