Skip to content

Instantly share code, notes, and snippets.

@rwcitek
Forked from sluugdemogithub/slide-deck.sh
Last active August 7, 2022 20:43
Show Gist options
  • Save rwcitek/b625975ee7edb3bc560a6ecaa50ac01d to your computer and use it in GitHub Desktop.
Save rwcitek/b625975ee7edb3bc560a6ecaa50ac01d to your computer and use it in GitHub Desktop.
Creating a new slidedesk repo from the jekyll-and-slide repo
# This gist combines specific commits from two different repos: jekyll-and-slide and reveal.js
# - https://github.com/adamhollett/jekyll-and-slide
# - https://github.com/hakimel/reveal.js
# If there was a way to do this from the browser, this gist would be unnecessary.
# prerequisite: create a blank repo in GitHub and note repo URL
# i.e. no README, no license, completely blank
REMOTE_URL='https://github.com/sluugdemogithub/demo03.git'
# create the URL for GitHub Pages
<<< "$REMOTE_URL" IFS='/' read scheme x host id repo
PAGES_URL="${scheme}//${id}.${host%com}io/${repo%.*}"
# do the following in a bash or equivalent shell
tmpdir=$( mktemp -d /tmp/gh-slidedeck.XXXXXX )
cd ${tmpdir}
# fetch jekyll-and-slide and reaveal.js
curl -L -o jekyll-and-slide.zip https://github.com/adamhollett/jekyll-and-slide/archive/3a9da81031cc48fa4b04f90d8872b8d6c5014c8c.zip
curl -L -o reveal-js.zip https://github.com/hakimel/reveal.js/archive/bef2722eedd9671a9e0f0f9e553c0863437d1402.zip
# setup Jekyll
unzip ${tmpdir}/jekyll-and-slide.zip
mv jekyll-and-slide-* jekyll-and-slide
cd jekyll-and-slide
rm -rf reveal.js/ .gitmodules
sed -i -e "/^url:/s#http.*#${PAGES_URL}#;/^baseurl:/s#/.*#/${repo%.*}#" _config.yml
# setup reveal.js
unzip ${tmpdir}/reveal-js.zip
mv reveal.js-* reveal.js
# setup as git repo, adjusting name and e-mail (or not)
git init -b main
git config --local user.name "demo"
git config --local user.email "demo@example.com"
git add .
git commit -m "first commit"
# push to the remote repo on GitHub
git remote add origin "${REMOTE_URL}"
git push origin main
rm -rf ${tmpdir}
# enable Pages on GitHub repo page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment