Browse Source

Switch out Makefile for minify shell script

pull/96/head
David DeSandro 13 years ago
parent
commit
295253d0cd
  1. 24
      Makefile
  2. 2
      _config.yml
  3. 14
      minify.sh

24
Makefile

@ -1,24 +0,0 @@
JS_ENGINE ?= `which node nodejs`
JS = jquery.isotope.js
JS_MIN = jquery.isotope.min.js
SITE = isotope-site
# minifies jquery.isotope.js
# requires NodeJS and global uglify-js
min: ${ISO}
@@if test ! -z ${JS_ENGINE}; then \
echo "Minifying" ${JS}; \
uglifyjs ${JS} > ${JS_MIN}.tmp; \
echo ';' >> ${JS_MIN}.tmp; \
sed 's/\*\//&§/g; y/§/\n/;' ${JS_MIN}.tmp > ${JS_MIN}; \
rm ${JS_MIN}.tmp; \
else \
echo "NodeJS required for minification."; \
fi
# creates zip file of site
zip: _site
mkdir ${SITE}
cp -r _site/ ${SITE}
zip -r ~/Desktop/${SITE}.zip ${SITE}/
rm -rf ${SITE}

2
_config.yml

@ -3,7 +3,7 @@ permalink: /:categories/:title.html
pygments: true
isotope_js: jquery.isotope.min.js
jquery_js: js/jquery-1.6.1.min.js
exclude: [ Makefile ]
exclude: [ minify.sh ]
random_order: [ 11, 91, 63, 38, 4, 25, 94, 29, 60, 48, 32, 67, 33, 37, 39, 84, 40, 7, 96, 8, 97, 9, 14, 99, 15, 19, 5, 36, 114, 20, 30, 80, 13, 47, 21, 3, 22, 31, 54, 66, 55, 71, 1, 23, 41, 70, 2, 77, 117, 79, 42, 95, 46, 50, 69, 53, 56, 72, 51, 73, 59, 74, 35, 49, 101, 88, 34, 76, 102, 75, 103, 81, 58, 6, 82, 26, 27, 44, 83, 45, 86, 68, 87, 104, 105, 10, 85, 43, 12, 109, 110, 113, 28, 106, 107, 108, 115, 62, 116, 0, 57, 111, 112, 61, 89, 90, 64, 65, 92, 93, 78, 24, 98, 100, 16, 17, 18, 52 ]

14
minify.sh

@ -0,0 +1,14 @@
#!/bin/bash
# minifies jquery.isotope.js
# requires nodejs & uglifyjs
JS=jquery.isotope.js
JS_MIN=jquery.isotope.min.js
TMP=$JS_MIN.tmp
uglifyjs $JS > $TMP
echo ';' >> $TMP
sed 's/\*\//&§/g; y/§/\n/;' $TMP > $JS_MIN
rm $TMP
echo "Minified" $JS "as" $JS_MIN
Loading…
Cancel
Save