Add genDocsHelper mage target

Expose the functionality of the hidden `hugo gen docshelper` command as
a mage target.
This commit is contained in:
Cameron Moore 2020-06-05 10:48:37 -05:00 committed by Bjørn Erik Pedersen
parent f720fe56db
commit 889dc47ceb

View file

@ -66,6 +66,7 @@ func flagEnv() map[string]string {
} }
} }
// Generate autogen packages
func Generate() error { func Generate() error {
generatorPackages := []string{ generatorPackages := []string{
"tpl/tplimpl/embedded/generate", "tpl/tplimpl/embedded/generate",
@ -101,6 +102,11 @@ func Generate() error {
return nil return nil
} }
// Generate docs helper
func GenDocsHelper() error {
return runCmd(flagEnv(), goexe, "run", "-tags", buildTags(), "main.go", "gen", "docshelper")
}
// Build hugo without git info // Build hugo without git info
func HugoNoGitInfo() error { func HugoNoGitInfo() error {
ldflags = noGitLdflags ldflags = noGitLdflags
@ -334,5 +340,4 @@ func buildTags() string {
return envtags return envtags
} }
return "none" return "none"
} }