From: Bjørn Erik Pedersen Date: Fri, 26 May 2017 18:31:45 +0000 (+0300) Subject: hubolib: Remove the regular page restriction from .Site.GetPage X-Git-Tag: v0.22~45 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=19de4476d8522ca8a63985b3d7efc165666bc35c;p=brevno-suite%2Fhugo hubolib: Remove the regular page restriction from .Site.GetPage See #2844 --- diff --git a/hugolib/site.go b/hugolib/site.go index e2540168..8740f11d 100644 --- a/hugolib/site.go +++ b/hugolib/site.go @@ -1892,18 +1892,10 @@ func (s *Site) Stats() { } // GetPage looks up a index page of a given type in the path given. -// This method may support regular pages in the future, but currently it is a -// convenient way of getting the home page or -// a section from a template: // {{ with .Site.GetPage "section" "blog" }}{{ .Title }}{{ end }} // // This will return nil when no page could be found. -// -// The valid page types are: home, section, taxonomy and taxonomyTerm func (s *SiteInfo) GetPage(typ string, path ...string) (*Page, error) { - if typ == KindPage { - return nil, errors.New("GetPage not supported for regular pages") - } return s.getPage(typ, path...), nil }