Every now and then I need to publish my presentation on the Web and – of course – each time I have to figure it out. So here is my recipe:
- I prepare my presentation on the branch in forked reveal.js repo. For example: this is source code for my talk at 4Developers Conference.
- When I’m done, I create new repo with a meaningful name (the name will be part of the url) – mytalk is just an example:
After some time (needed by GitHub to process repo) my presentation will show up at: http://username.github.io/mytalk/
git remote add origin https://github.com/username/mytalk
git checkout -b gh-pages
git remote add reveal.js https://github.com/username/reveal.js
git fetch reveal.js
git merge --ff-only reveal.js/mytalk
git push -u origin gh-pages
You can also set custom (sub)domain for GitHub Pages:
- Add CNAME record via your DNS provider pointing from mytalk.mydomain.com to username.github.io.
- Add CNAME file to your repo (on gh-pages branch) containing single line with your domain (mytalk.mydomain.com). See working example: https://github.com/orient-man/4Dev2015/blob/gh-pages/CNAME