summaryrefslogtreecommitdiffstats
path: root/hugolib/shortcode.go
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 /hugolib/shortcode.go
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 'hugolib/shortcode.go')
-rw-r--r--hugolib/shortcode.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/hugolib/shortcode.go b/hugolib/shortcode.go
index c12fb888b..e201d4d6b 100644
--- a/hugolib/shortcode.go
+++ b/hugolib/shortcode.go
@@ -185,8 +185,8 @@ func (scp *ShortcodeWithPage) page() page.Page {
// Note - this value must not contain any markup syntax
const shortcodePlaceholderPrefix = "HAHAHUGOSHORTCODE"
-func createShortcodePlaceholder(id string, ordinal int) string {
- return shortcodePlaceholderPrefix + id + strconv.Itoa(ordinal) + "HBHB"
+func createShortcodePlaceholder(sid string, id, ordinal int) string {
+ return shortcodePlaceholderPrefix + strconv.Itoa(id) + sid + strconv.Itoa(ordinal) + "HBHB"
}
type shortcode struct {