1
0
mirror of https://github.com/gohugoio/hugo.git synced 2024-05-11 05:54:58 +00:00

Add all config to docshelper.json

Also consolidate so the mediaTypes and outputFormats are listed once only.

Fixes #11328
This commit is contained in:
Bjørn Erik Pedersen
2023-08-07 10:52:52 +02:00
parent d4a6c16c17
commit 851bf3515e
15 changed files with 1023 additions and 770 deletions

View File

@ -30,6 +30,8 @@ import (
"github.com/gohugoio/hugo/docshelper"
"github.com/gohugoio/hugo/helpers"
"github.com/gohugoio/hugo/hugofs"
"github.com/gohugoio/hugo/hugolib"
"github.com/gohugoio/hugo/parser"
"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"
)
@ -197,6 +199,14 @@ url: %s
enc := json.NewEncoder(f)
enc.SetIndent("", " ")
configProvider := func() docshelper.DocProvider {
conf := hugolib.DefaultConfig()
conf.CacheDir = "" // The default value does not make sense in the docs.
defaultConfig := parser.LowerCaseCamelJSONMarshaller{Value: conf}
return docshelper.DocProvider{"config": defaultConfig}
}
docshelper.AddDocProviderFunc(configProvider)
if err := enc.Encode(docshelper.GetDocProvider()); err != nil {
return err
}