Make build.writeStats a struct

So you can do

```toml
[build.writeStats]
  tags = true
  classes = true
  ids = false
```

Fixes #11191
This commit is contained in:
Bjørn Erik Pedersen
2023-07-01 10:37:38 +02:00
parent da98724bc8
commit 11ecea6106
7 changed files with 166 additions and 14 deletions

View File

@@ -81,8 +81,8 @@ func NewDestinationPublisher(rs *resources.Spec, outputFormats output.Formats, m
fs := rs.BaseFs.PublishFs
cfg := rs.Cfg
var classCollector *htmlElementsCollector
if rs.BuildConfig().WriteStats {
classCollector = newHTMLElementsCollector()
if rs.BuildConfig().WriteStats.Enabled() {
classCollector = newHTMLElementsCollector(rs.BuildConfig().WriteStats)
}
pub = DestinationPublisher{fs: fs, htmlElementsCollector: classCollector}
pub.min, err = minifiers.New(mediaTypes, outputFormats, cfg)