Created
April 27, 2020 18:22
-
-
Save veggiemonk/d8fac2af8f6397052f92ae64ef0d3aba to your computer and use it in GitHub Desktop.
small bash scripts to migrate all slides
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
rm -rf presentations | |
mkdir -p presentations | |
function create_html() { | |
local HTML='<!DOCTYPE html><html lang="en"><head><meta charset="UTF-8" /><meta name="viewport" content="width=device-width, initial-scale=1.0" /><title>Presentations</title></head><body><ul>' | |
for i in *; do | |
echo "PRES: $i" | |
if test -d "$i" && test -e "$i/index.html"; then | |
echo "OK" | |
if [ "$i" != "reveal.js" ]; then | |
cp "$i/index.html" "presentations/$i.html" | |
HTML="${HTML}<li><a href=\"/presentations/$i.html\">$i</a></li>" | |
fi | |
fi | |
done | |
HTML="${HTML}</ul></body></html>" | |
echo "${HTML}" > index.html | |
} | |
create_html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment