summaryrefslogtreecommitdiffstats
path: root/tpl/internal
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-08-01 18:12:36 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-08-03 20:00:57 +0200
commitade7ec818798c0e5507d4fb6cc5b4396262a85d6 (patch)
treefe1e2e18922b20286113d66e171dfecc861d30ff /tpl/internal
parent8fa8ce3e48c8812daa1eecc8865b653336d98147 (diff)
Add Page.RenderShortcodes
A layouts/shortcodes/include.html shortcode may look like this: ```html {{ $p := site.GetPage (.Get 0) }} {{ $p.RenderShortcodes }} ``` Fixes #7297
Diffstat (limited to 'tpl/internal')
-rw-r--r--tpl/internal/go_templates/texttemplate/hugo_template.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/tpl/internal/go_templates/texttemplate/hugo_template.go b/tpl/internal/go_templates/texttemplate/hugo_template.go
index acfa2f166..78be55e18 100644
--- a/tpl/internal/go_templates/texttemplate/hugo_template.go
+++ b/tpl/internal/go_templates/texttemplate/hugo_template.go
@@ -60,9 +60,10 @@ func NewExecuter(helper ExecHelper) Executer {
}
type (
- pageContextKeyType string
- hasLockContextKeyType string
- stackContextKeyType string
+ pageContextKeyType string
+ hasLockContextKeyType string
+ stackContextKeyType string
+ callbackContextKeyType string
)
const (
@@ -70,6 +71,9 @@ const (
PageContextKey = pageContextKeyType("page")
// Used in partialCached to signal to nested templates that a lock is already taken.
HasLockContextKey = hasLockContextKeyType("hasLock")
+
+ // Used to pass down a callback function to nested templates.
+ CallbackContextKey = callbackContextKeyType("callback")
)
// Note: The context is currently not fully implemented in Hugo. This is a work in progress.