diff options
author | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-12-21 09:51:15 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2018-12-21 09:51:15 +0100 |
commit | 1021714449a05ef85b2fdfaf65b354cbdee44f23 (patch) | |
tree | c92c11867d9af5a78cade6d7554387accdf789ef /hugolib/shortcode.go | |
parent | 6f069e549b869c976cb6576a64812df5e7b7c809 (diff) |
hugolib: Add .Name as a shortcode variable
Fixes #5546
Diffstat (limited to 'hugolib/shortcode.go')
-rw-r--r-- | hugolib/shortcode.go | 3 |
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 } |