-
-
Save rwcitek/b625975ee7edb3bc560a6ecaa50ac01d to your computer and use it in GitHub Desktop.
Creating a new slidedesk repo from the jekyll-and-slide repo
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
# 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 "[email protected]" | |
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