minification.md (662B)
1 --- 2 title: Asset minification 3 description: Hugo Pipes allows the minification of any CSS, JS, JSON, HTML, SVG or XML resource. 4 date: 2018-07-14 5 publishdate: 2018-07-14 6 lastmod: 2018-07-14 7 categories: [asset management] 8 keywords: [] 9 menu: 10 docs: 11 parent: "pipes" 12 weight: 50 13 weight: 50 14 sections_weight: 50 15 draft: false 16 --- 17 18 19 Any resource of the aforementioned types can be minified using `resources.Minify` which takes for argument the resource object. 20 21 22 ```go-html-template 23 {{ $css := resources.Get "css/main.css" }} 24 {{ $style := $css | resources.Minify }} 25 ``` 26 27 Note that you can also minify the final HTML output to `/public` by running `hugo --minify`.