diff options
[hooks] Reworked all hooks to use awk for their logic
1 files changed, 2 insertions, 17 deletions
| -rwxr-xr-x | generate-hooks/make-presentation.sh | 19 |
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>&&presentation<\/p>/$presentation/g; - s/<p>&&slide<\/p>/<div class=\"slide\">/g;s/<p>&&/slide<\/p>/<\/div>/g; - s/<p>&&centered<\/p>/<div class=\"centered\">/g;s/<p>&&/centered<\/p>/<\/div>/g; - s/<p>&&flexer<\/p>/<div class=\"flexer\"><\/div>/g;s/&&flexer/<div class=\"flexer\"><\/div>/g; - s/<p>&&fow<\/p>/<div class=\"fow\">/g;s/<p>&&/fow<\/p>/<\/div>/g; - s/<p>&&fol<\/p>/<div class=\"fol\">/g;s/<p>&&/fol<\/p>/<\/div>/g" \ - "$file" + awk -f "$awkloc" $file > tmp && mv -f tmp $file done |