Create an alias from shortcode.Page.Site to shortcode.Site
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 14 Mar 2016 13:10:15 +0000 (14:10 +0100)
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Mon, 14 Mar 2016 13:10:15 +0000 (14:10 +0100)
Fixes #1976

hugolib/shortcode.go

index 578093210e1116856835c840f21ee9ead84471a0..b221ff8a7158434294cb75ff7c260fec606620a6 100644 (file)
@@ -38,6 +38,10 @@ type ShortcodeWithPage struct {
        IsNamedParams bool
 }
 
+func (scp *ShortcodeWithPage) Site() *SiteInfo {
+       return scp.Page.Site
+}
+
 func (scp *ShortcodeWithPage) Ref(ref string) (string, error) {
        return scp.Page.Ref(ref)
 }