summaryrefslogtreecommitdiff
path: root/publish
diff options
context:
space:
mode:
Diffstat (limited to 'publish')
-rwxr-xr-xpublish47
1 files changed, 47 insertions, 0 deletions
diff --git a/publish b/publish
new file mode 100755
index 0000000..5436428
--- /dev/null
+++ b/publish
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+HERE=$(dirname $(readlink -f ${0}))/src;
+
+HTML=html;
+rm -fr ${HTML} ${HTML}.tgz;
+mkdir ${HTML};
+
+##
+# .psd --> .jpg
+#
+find ${HERE} -type f -name "*.psd" | while read k; do
+ f="${k#*${HERE}}";
+ mkdir -p "${HTML}${f%/*}";
+ convert "${k}[0]" -strip "${HTML}${f%*.psd}.webp";
+done
+
+##
+# template injection
+#
+find ${HERE} -type f -name "*.html" | while read k; do
+ f="${k#*${HERE}}";
+ mkdir -p "${HTML}${f%/*}";
+ sed > "${HTML}${f}" "${k}" \
+ -e "/__HEADER__/r ${HERE}/header.fill" \
+ -e 's/__HEADER__//g' \
+ -e "/__FOOTER__/r ${HERE}/footer.fill" \
+ -e 's/__FOOTER__//g' \
+ -e "/__INDEPENDENT_SHADE__/r ${HERE}/independent.shade.fill" \
+ -e 's/__INDEPENDENT_SHADE__//g' \
+ -e "/__INDEPENDENT_WHITE__/r ${HERE}/independent.white.fill" \
+ -e 's/__INDEPENDENT_WHITE__//g' \
+ ;
+done
+
+##
+# static assets
+#
+cp -R ${HERE}/../assets ${HTML};
+
+##
+# payload
+#
+(
+ cd ${HTML};
+ tar -pczf ../${HTML}.tgz .;
+)