summaryrefslogtreecommitdiffstats
path: root/hugolib/shortcode.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-12-21 09:51:15 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2018-12-21 09:51:15 +0100
commit1021714449a05ef85b2fdfaf65b354cbdee44f23 (patch)
treec92c11867d9af5a78cade6d7554387accdf789ef /hugolib/shortcode.go
parent6f069e549b869c976cb6576a64812df5e7b7c809 (diff)
hugolib: Add .Name as a shortcode variable
Fixes #5546
Diffstat (limited to 'hugolib/shortcode.go')
-rw-r--r--hugolib/shortcode.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/hugolib/shortcode.go b/hugolib/shortcode.go
index db7bf2c62..6d87414a7 100644
--- a/hugolib/shortcode.go
+++ b/hugolib/shortcode.go
@@ -58,6 +58,7 @@ type ShortcodeWithPage struct {
Inner template.HTML
Page *PageWithoutContent
Parent *ShortcodeWithPage
+ Name string
IsNamedParams bool
// Zero-based ordinal in relation to its parent. If the parent is the page itself,
@@ -401,7 +402,7 @@ func renderShortcode(
return "", nil
}
- data := &ShortcodeWithPage{Ordinal: sc.ordinal, posOffset: sc.pos, Params: sc.params, Page: p, Parent: parent}
+ data := &ShortcodeWithPage{Ordinal: sc.ordinal, posOffset: sc.pos, Params: sc.params, Page: p, Parent: parent, Name: sc.name}
if sc.params != nil {
data.IsNamedParams = reflect.TypeOf(sc.params).Kind() == reflect.Map
}