Summary Files Commits Branches @commit @diff @stats
path: root / generate-hooks / make-presentation.sh
diff options
context:
space:
mode:
Commit62daf522a1e51c4a1d9d8b31d2a0093da86ebc5d (patch)
Author
 Syndamia <kamen@syndamia.com>
2022-09-28 17:15:36 +0300
Committer
 Syndamia <kamen@syndamia.com>
2022-09-29 17:40:09 +0300
Files7474bc314afde18b6e53bb6702f54a04c5a87ed1 /generate-hooks/make-presentation.sh
syndamia.com-62daf522a1e51c4a1d9d8b31d2a0093da86ebc5d.tar
syndamia.com-62daf522a1e51c4a1d9d8b31d2a0093da86ebc5d.tar.gz
syndamia.com-62daf522a1e51c4a1d9d8b31d2a0093da86ebc5d.zip
Parenta8b5c3c03b37ebf90e7ee8c9cb7c8f913f50c79a (diff)
[hooks] Reworked all hooks to use awk for their logic
1 files changed, 2 insertions, 17 deletions
-rwxr-xr-xgenerate-hooks/make-presentation.sh19
diff --git a/generate-hooks/make-presentation.sh b/generate-hooks/make-presentation.sh
index dab3243..c27fba2 100755
--- a/generate-hooks/make-presentation.sh
+++ b/generate-hooks/make-presentation.sh
@@ -30,23 +30,8 @@ if [ -z "$1" ]; then
exit
fi
-presentation='
- <nav id="presentCont">
- <img id="prevSlideBtn" class="unzoomable btn setting-btn icon nodisplay" src="/img/arrow-left-tabler.svg" alt="Previous">
- <img id="nextSlideBtn" class="unzoomable btn setting-btn icon nodisplay" src="/img/arrow-right-tabler.svg" alt="Next">
- <img id="presentBtn" class="unzoomable btn setting-btn icon" src="/img/presentation-tabler.svg" alt="Present">
- <img id="printBtn" class="unzoomable btn setting-btn icon" src="/img/printer-tabler.svg" alt="Print">
- </nav>
- <script type="text/javascript" src="/scripts/presentation.js" integrity="sha512-79MwfB0EQJMdVjVnd3PA0Cn9fo4JaMUmNuyZNEGSbaMEGcqdE8sWWAbMLheaoptDyb/KuYgNw0pKwvR5Dw+lJw==" crossorigin="anonymous"></script>'
-presentation=$(echo $presentation | sed 's/\//\\\//g')
+awkloc="$(dirname "$0")/create-presentation.awk"
-# Loop through all HTML files in given directory
for file in $(echo $1 | grep 'talks'); do
- sed -i "s/<p>&#38;&#38;presentation<\/p>/$presentation/g;
- s/<p>&#38;&#38;slide<\/p>/<div class=\"slide\">/g;s/<p>&#38;&#38;&#47;slide<\/p>/<\/div>/g;
- s/<p>&#38;&#38;centered<\/p>/<div class=\"centered\">/g;s/<p>&#38;&#38;&#47;centered<\/p>/<\/div>/g;
- s/<p>&#38;&#38;flexer<\/p>/<div class=\"flexer\"><\/div>/g;s/&#38;&#38;flexer/<div class=\"flexer\"><\/div>/g;
- s/<p>&#38;&#38;fow<\/p>/<div class=\"fow\">/g;s/<p>&#38;&#38;&#47;fow<\/p>/<\/div>/g;
- s/<p>&#38;&#38;fol<\/p>/<div class=\"fol\">/g;s/<p>&#38;&#38;&#47;fol<\/p>/<\/div>/g" \
- "$file"
+ awk -f "$awkloc" $file > tmp && mv -f tmp $file
done