<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>minify on MXI</title><link>https://mxii.eu.org/tags/minify/</link><description>Recent content in minify on MXI</description><generator>Hugo -- gohugo.io</generator><language>en-us</language><lastBuildDate>Wed, 17 Aug 2016 00:31:11 +0300</lastBuildDate><atom:link href="https://mxii.eu.org/tags/minify/index.xml" rel="self" type="application/rss+xml"/><item><title>Blog minification in a fancy way with PowerShell</title><link>https://mxii.eu.org/2016/08/17/blog-minification-in-a-fancy-way-with-powershell/</link><pubDate>Wed, 17 Aug 2016 00:31:11 +0300</pubDate><guid>https://mxii.eu.org/2016/08/17/blog-minification-in-a-fancy-way-with-powershell/</guid><description>&lt;p>There is no built-in support for minification in Hugo engine, which isn&amp;rsquo;t a bad thing on its own. But I had to figure out a way to minify my files while keeping building and maintenance extremely simple.&lt;/p>
&lt;p>At first point I added &lt;a href="https://github.com/tdewolff/minify/tree/master/cmd/minify">minify&lt;/a> for text files. It&amp;rsquo;s a single binary (written in Go), and with a single call it can run recursively over Hugo&amp;rsquo;s public folder, minifying output files in-place, just as I needed.&lt;/p>
&lt;p>But minifying images is a more tricky task. I decided to use &lt;a href="http://jpegclub.org/jpegtran/">jpegtran&lt;/a> and &lt;a href="http://optipng.sourceforge.net/">optipng&lt;/a>, but they can&amp;rsquo;t be run recursively. Some scripting is required to use them. While the task of finding all the images in a folder and applying minifiers on them is trivial and can be solved with PowerShell one-liner, it was not satisfying enough, so I end up with the thing described below in this post.&lt;/p>
&lt;p>Additional motivation is to have a tool that can be adopted easily to any other processing task and will give me a fancy progress report.&lt;/p></description></item></channel></rss>