aboutsummaryrefslogtreecommitdiffhomepage
path: root/publisher
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2020-03-20 16:34:53 +0100
committerBjørn Erik Pedersen <[email protected]>2020-03-20 20:35:57 +0100
commit7204b354a9f46778f068a4712447d6d4fefbefd8 (patch)
treea7d58d64fb9266f5c3f28251cb677b245925e728 /publisher
parent574c2959b8d3338764fa1db102a5e0fd6ed322d9 (diff)
downloadhugo-7204b354a9f46778f068a4712447d6d4fefbefd8.tar.gz
hugo-7204b354a9f46778f068a4712447d6d4fefbefd8.zip
Some minify configuration adjustments
Diffstat (limited to 'publisher')
-rw-r--r--publisher/publisher.go17
1 files changed, 6 insertions, 11 deletions
diff --git a/publisher/publisher.go b/publisher/publisher.go
index e1179572b..f30073c08 100644
--- a/publisher/publisher.go
+++ b/publisher/publisher.go
@@ -68,21 +68,16 @@ type Descriptor struct {
// DestinationPublisher is the default and currently only publisher in Hugo. This
// publisher prepares and publishes an item to the defined destination, e.g. /public.
type DestinationPublisher struct {
- fs afero.Fs
- minify bool
- min minifiers.Client
+ fs afero.Fs
+ min minifiers.Client
}
// NewDestinationPublisher creates a new DestinationPublisher.
func NewDestinationPublisher(fs afero.Fs, outputFormats output.Formats, mediaTypes media.Types, cfg config.Provider) (pub DestinationPublisher, err error) {
pub = DestinationPublisher{fs: fs}
- minify := cfg.GetBool("minify")
- if minify {
- pub.min, err = minifiers.New(mediaTypes, outputFormats, cfg)
- if err != nil {
- return
- }
- pub.minify = true
+ pub.min, err = minifiers.New(mediaTypes, outputFormats, cfg)
+ if err != nil {
+ return
}
return
}
@@ -155,7 +150,7 @@ func (p DestinationPublisher) createTransformerChain(f Descriptor) transform.Cha
}
- if p.minify {
+ if p.min.MinifyOutput {
minifyTransformer := p.min.Transformer(f.OutputFormat.MediaType)
if minifyTransformer != nil {
transformers = append(transformers, minifyTransformer)