diff --git a/concat-example.sh b/concat-example.sh new file mode 100644 index 0000000..5e614aa --- /dev/null +++ b/concat-example.sh @@ -0,0 +1,23 @@ +function magic() { + FN="$1.$2" + MD5="$1_$(md5sum "$FN" | cut -f1 -d' ').$2" + sed -i -e "s/$FN/$MD5/" index.html + mv "$FN" "$MD5" +} + + +for file in $(grep -oP -e '"stylesheet" href="\K[^"]*' index.html); do + sed -i -e "\\#$file#d" index.html + cat $file >> all.css +done +sed -i -e 's$.*CSS_ANCHOR.*$\0\n$' index.html +magic all css + + +for file in $(grep -oP -e 'script src="\K[^"]*' index.html); do + sed -i -e "\\#$file#d" index.html + cat "$file" >> all.js +done +sed -i -e 's$.*JS_ANCHOR.*$\0\n$' index.html +magic all js + diff --git a/html/index.html b/html/index.html index 91bf660..7ba5efe 100644 --- a/html/index.html +++ b/html/index.html @@ -8,6 +8,7 @@ + @@ -898,6 +899,7 @@
+