allow nested params when using Pages.GroupByParam and Pages.GroupByParamDate

This commit is contained in:
n1xx1
2024-08-01 13:12:32 +02:00
committed by Bjørn Erik Pedersen
parent be643580dd
commit 51f09b17fd
2 changed files with 63 additions and 2 deletions

View File

@@ -14,6 +14,7 @@
package resource
import (
"github.com/gohugoio/hugo/common/maps"
"strings"
"time"
@@ -36,9 +37,9 @@ func GetParamToLower(r Resource, key string) any {
}
func getParam(r Resource, key string, stringToLower bool) any {
v := r.Params()[strings.ToLower(key)]
v, err := maps.GetNestedParam(key, ".", r.Params())
if v == nil {
if v == nil || err != nil {
return nil
}