resources/page: Re-introduce .Page.Page

It was removed in 597e418cb0 -- it's not documented, but it's used in too many real sites on the web.

See #5784
This commit is contained in:
Bjørn Erik Pedersen
2019-03-25 07:54:10 +01:00
parent b5f39d23b8
commit 91ef9655aa
5 changed files with 22 additions and 1 deletions

View File

@@ -107,7 +107,12 @@ func generateMarshalJSON(c *codegen.Inspector) error {
return errors.New("no methods found")
}
marshalJSON, pkgImports := methods.ToMarshalJSON("Page", "github.com/gohugoio/hugo/resources/page")
marshalJSON, pkgImports := methods.ToMarshalJSON(
"Page",
"github.com/gohugoio/hugo/resources/page",
// Exclusion regexps. Matches method names.
`\bPage\b`,
)
fmt.Fprintf(f, `%s