summaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-08-07 10:52:52 +0200
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2023-08-07 13:42:54 +0200
commit851bf3515e61141cda6209fb196f4505c826607c (patch)
tree4c227fb57c849638059836a4f490d0c5c0da0a42 /commands
parentd4a6c16c17b8804c13c9c0a5526be01fc238c67a (diff)
Add all config to docshelper.json
Also consolidate so the mediaTypes and outputFormats are listed once only. Fixes #11328
Diffstat (limited to 'commands')
-rw-r--r--commands/gen.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/commands/gen.go b/commands/gen.go
index 1a3cf2174..02df720c8 100644
--- a/commands/gen.go
+++ b/commands/gen.go
@@ -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
}