pdssg

Pandoc static site generator
Log | Files | Refs | README | LICENSE

commit f0c1d44d1204446c6abdb80b0a5e8b0575490155
parent 7c7b728c3e9cad315b2c481d8d9b1799abe15dc9
Author: Byron Torres <b@torresjrjr.com>
Date:   Mon, 12 Oct 2020 22:26:28 +0100

New feature: minify CSS file

Use vim filter to minify the CSS file './ast/style.css'.
Tests showed ~40% size reduction.

Diffstat:
Mpdssg | 17+++++++++++++++++
1 file changed, 17 insertions(+), 0 deletions(-)

diff --git a/pdssg b/pdssg @@ -71,6 +71,23 @@ prepare_dst() { FEEDS_DIR="$(< ./_feeds)" FEEDS_DIR=${FEEDSDIR:-./feeds} echo "Dir: $FEEDS_DIR" + + STYLESHEET="./ast/style.css" + echo "Minifying CSS file $STYLESHEET" + vim $STYLESHEET -es --not-a-term +' + %s/\s*:\s*/:/g + %s/\s*;\s*/;/g + %s/\s*,\s*/,/g + %s/\s*{\s*/{/g + %s/\s*}\s*/}/g + %s/\s*(\s*/(/g + %s/\s*)\s*/)/g + %s/^\s*// + %s/\n// + %s/\/\*.\{-}\*\///g + %s/;}/}/g + wq! + ' } find_feeds() {