mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
Add Page.RenderShortcodes
A layouts/shortcodes/include.html shortcode may look like this: ```html {{ $p := site.GetPage (.Get 0) }} {{ $p.RenderShortcodes }} ``` Fixes #7297
This commit is contained in:
@@ -191,6 +191,14 @@ func SetHasLockInContext(ctx context.Context, hasLock bool) context.Context {
|
||||
return context.WithValue(ctx, texttemplate.HasLockContextKey, hasLock)
|
||||
}
|
||||
|
||||
func GetCallbackFunctionFromContext(ctx context.Context) any {
|
||||
return ctx.Value(texttemplate.CallbackContextKey)
|
||||
}
|
||||
|
||||
func SetCallbackFunctionInContext(ctx context.Context, fn any) context.Context {
|
||||
return context.WithValue(ctx, texttemplate.CallbackContextKey, fn)
|
||||
}
|
||||
|
||||
const hugoNewLinePlaceholder = "___hugonl_"
|
||||
|
||||
var (
|
||||
|
Reference in New Issue
Block a user