Skip to content

Instantly share code, notes, and snippets.

@veggiemonk
Created April 27, 2020 18:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save veggiemonk/d8fac2af8f6397052f92ae64ef0d3aba to your computer and use it in GitHub Desktop.
Save veggiemonk/d8fac2af8f6397052f92ae64ef0d3aba to your computer and use it in GitHub Desktop.
small bash scripts to migrate all slides
#!/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