Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-06-15 17:33:09 +0300
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2020-06-15 23:23:02 +0300
commit522ba1cd98ac67482061448c3a7528e68a720f0d (patch)
tree527560bfa89b66683c1118d132c8270b42812777 /hugolib/content_map_page.go
parent889dc47ceba9cf5cbd6e61a9222a5e54cd562332 (diff)
Fix order of GetTerms
Preserve the order from front matter, which would be behaviour when doing this manually (before GetTerms). Fixes #7213
Diffstat (limited to 'hugolib/content_map_page.go')
-rw-r--r--hugolib/content_map_page.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/hugolib/content_map_page.go b/hugolib/content_map_page.go
index 7516a7029..8c7ecc341 100644
--- a/hugolib/content_map_page.go
+++ b/hugolib/content_map_page.go
@@ -579,7 +579,6 @@ func (m *pageMap) attachPageToViews(s string, b *contentNode) {
if vals == nil {
continue
}
-
w := getParamToLower(b.p, viewName.plural+"_weight")
weight, err := cast.ToIntE(w)
if err != nil {
@@ -587,11 +586,12 @@ func (m *pageMap) attachPageToViews(s string, b *contentNode) {
// weight will equal zero, so let the flow continue
}
- for _, v := range vals {
+ for i, v := range vals {
termKey := m.s.getTaxonomyKey(v)
bv := &contentNode{
viewInfo: &contentBundleViewInfo{
+ ordinal: i,
name: viewName,
termKey: termKey,
termOrigin: v,