diff options
author | Bjørn Erik Pedersen <[email protected]> | 2023-01-04 18:24:36 +0100 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2023-05-16 18:01:29 +0200 |
commit | 241b21b0fd34d91fccb2ce69874110dceae6f926 (patch) | |
tree | d4e0118eac7e9c42f065815447a70805f8d6ad3e /publisher | |
parent | 6aededf6b42011c3039f5f66487a89a8dd65e0e7 (diff) | |
download | hugo-241b21b0fd34d91fccb2ce69874110dceae6f926.tar.gz hugo-241b21b0fd34d91fccb2ce69874110dceae6f926.zip |
Create a struct with all of Hugo's config options
Primary motivation is documentation, but it will also hopefully simplify the code.
Also,
* Lower case the default output format names; this is in line with the custom ones (map keys) and how
it's treated all the places. This avoids doing `stringds.EqualFold` everywhere.
Closes #10896
Closes #10620
Diffstat (limited to 'publisher')
-rw-r--r-- | publisher/htmlElementsCollector_test.go | 7 | ||||
-rw-r--r-- | publisher/publisher.go | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/publisher/htmlElementsCollector_test.go b/publisher/htmlElementsCollector_test.go index f9c9424cb..7aeda0daf 100644 --- a/publisher/htmlElementsCollector_test.go +++ b/publisher/htmlElementsCollector_test.go @@ -22,7 +22,7 @@ import ( "testing" "time" - "github.com/gohugoio/hugo/config" + "github.com/gohugoio/hugo/config/testconfig" "github.com/gohugoio/hugo/media" "github.com/gohugoio/hugo/minifiers" "github.com/gohugoio/hugo/output" @@ -141,9 +141,8 @@ func TestClassCollector(t *testing.T) { if skipMinifyTest[test.name] { c.Skip("skip minify test") } - v := config.NewWithTestDefaults() - m, _ := minifiers.New(media.DefaultTypes, output.DefaultFormats, v) - m.Minify(media.HTMLType, w, strings.NewReader(test.html)) + m, _ := minifiers.New(media.DefaultTypes, output.DefaultFormats, testconfig.GetTestConfig(nil, nil)) + m.Minify(media.Builtin.HTMLType, w, strings.NewReader(test.html)) } else { var buff bytes.Buffer diff --git a/publisher/publisher.go b/publisher/publisher.go index 63eb1011f..970c93e6c 100644 --- a/publisher/publisher.go +++ b/publisher/publisher.go @@ -81,7 +81,7 @@ func NewDestinationPublisher(rs *resources.Spec, outputFormats output.Formats, m fs := rs.BaseFs.PublishFs cfg := rs.Cfg var classCollector *htmlElementsCollector - if rs.BuildConfig.WriteStats { + if rs.BuildConfig().WriteStats { classCollector = newHTMLElementsCollector() } pub = DestinationPublisher{fs: fs, htmlElementsCollector: classCollector} |