-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Compactação do HTML com HTMLMinifier, por enquanto com bug (kangax/ht…
- Loading branch information
1 parent
ae5a5b0
commit 668915b
Showing
2 changed files
with
25 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters