hugo: github.com/gohugoio/hugo/minifiers Index | Files

package minifiers

import "github.com/gohugoio/hugo/minifiers"

Package minifiers contains minifiers mapped to MIME types. This package is used in both the resource transformation, i.e. resources.Minify, and in the publishing chain.

Index

Package Files

config.go minifiers.go

type Client Uses

type Client struct {
    // Whether output minification is enabled (HTML in /public)
    MinifyOutput bool
    // contains filtered or unexported fields
}

Client wraps a minifier.

func New Uses

func New(mediaTypes media.Types, outputFormats output.Formats, cfg config.Provider) (Client, error)

New creates a new Client with the provided MIME types as the mapping foundation. The HTML minifier is also registered for additional HTML types (AMP etc.) in the provided list of output formats.

func (Client) Minify Uses

func (m Client) Minify(mediatype media.Type, dst io.Writer, src io.Reader) error

Minify tries to minify the src into dst given a MIME type.

func (Client) Transformer Uses

func (m Client) Transformer(mediatype media.Type) transform.Transformer

Transformer returns a func that can be used in the transformer publishing chain. TODO(bep) minify config etc

Package minifiers imports 17 packages (graph) and is imported by 26 packages. Updated 2020-03-26. Refresh now. Tools for package owners.