From 53cfad893920ec2cc4d05b2df98cddbae47715f8 Mon Sep 17 00:00:00 2001 From: Matthias Wirth Date: Mon, 30 Nov 2020 22:27:32 +0100 Subject: [PATCH] concat example and anchors for messing with the html --- concat-example.sh | 23 +++++++++++++++++++++++ html/index.html | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 concat-example.sh 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 @@
+