mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-20 21:31:32 +02:00
@@ -159,12 +159,7 @@ func (p Pages) GroupBy(ctx context.Context, key string, order ...string) (PagesG
|
||||
case reflect.StructField:
|
||||
fv = ppv.Elem().FieldByName(key)
|
||||
case reflect.Method:
|
||||
var args []reflect.Value
|
||||
fn := hreflect.GetMethodByName(ppv, key)
|
||||
if fn.Type().NumIn() > 0 && fn.Type().In(0).Implements(hreflect.ContextInterface) {
|
||||
args = []reflect.Value{reflect.ValueOf(ctx)}
|
||||
}
|
||||
fv = fn.Call(args)[0]
|
||||
fv = hreflect.CallMethodByName(ctx, key, ppv)[0]
|
||||
}
|
||||
if !fv.IsValid() {
|
||||
continue
|
||||
|
Reference in New Issue
Block a user