Skip to content

Commit

Permalink
Compactação do HTML com HTMLMinifier, por enquanto com bug (kangax/ht…
Browse files Browse the repository at this point in the history
  • Loading branch information
vinyanalista committed Jul 25, 2015
1 parent ae5a5b0 commit 668915b
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions minify_html.sh
@@ -0,0 +1,24 @@
#!/bin/bash
# minify_html.sh
if test $# -ne 2
then
echo "usage: sh minify_html.sh sourcedir destdir";
exit 1;
fi

set -xv

for FOLDER in `find $1 -type d`
do
mkdir -p "$2/${FOLDER#$1}";
done

for HTML_FILE in `find $1 -type f -name "*.html"`
do
html-minifier --remove-comments -o "$2/${HTML_FILE#$1}" "$HTML_FILE";
done

for ASSET in `find $1 -type f ! -name "*.html"`
do
cp "$ASSET" "$2/${ASSET#$1}";
done
2 changes: 1 addition & 1 deletion online.sh
Expand Up @@ -5,7 +5,7 @@ jekyll build
cd ../vinyanalista.github.io/
git rm -rf *
touch .nojekyll
cp -r ../vinyanalista-website/_site/* .
sh minify_html.sh ../vinyanalista-website/_site .
git add --all .
git commit -m "Atualização do site (ver commit $HASH_DO_COMMIT_ATUAL do repositório vinyanalista-website)"
git push
Expand Down

0 comments on commit 668915b

Please sign in to comment.