aboutsummaryrefslogtreecommitdiffhomepage
path: root/common/hreflect
diff options
context:
space:
mode:
authorn1xx1 <[email protected]>2024-08-01 12:14:29 +0200
committerGitHub <[email protected]>2024-08-01 12:14:29 +0200
commit566fe7ba12e7ecabadffa9ec76b319d04063c78b (patch)
tree227ffdfe6d1cb203f87f2930b9d892adb243805c /common/hreflect
parent92573012e83bf8d71a247027d2f7f7f43a9c42b7 (diff)
downloadhugo-566fe7ba12e7ecabadffa9ec76b319d04063c78b.tar.gz
hugo-566fe7ba12e7ecabadffa9ec76b319d04063c78b.zip
resources/page: Expand parmalinks tokens in `url`
This change allows to use permalink tokens in url front matter fields. This should be useful to target more specific pages instead of using a global permalink configuration. It's expected to be used with cascade. Fixes #9714
Diffstat (limited to 'common/hreflect')
-rw-r--r--common/hreflect/helpers.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/hreflect/helpers.go b/common/hreflect/helpers.go
index b5a8bacc9..5113a3886 100644
--- a/common/hreflect/helpers.go
+++ b/common/hreflect/helpers.go
@@ -268,7 +268,8 @@ func IsContextType(tp reflect.Type) bool {
return true
}
- return isContextCache.GetOrCreate(tp, func() bool {
- return tp.Implements(contextInterface)
+ isContext, _ := isContextCache.GetOrCreate(tp, func() (bool, error) {
+ return tp.Implements(contextInterface), nil
})
+ return isContext
}