Revealjs Cookbook
A markdown file as a ppt/slides using Revealjs.
My Live Demo as a template. http://blog.ant-abel.com/revealjs-cookbook/
- sample as a reference: https://raw.githubusercontent.com/evilz/vscode-reveal/master/sample.md
View it in vscode and export it from the extension as a static site. My live demo is come from here.
Sometimes you want to have a subdirectory on the master
branch be the root directory of a repository’s gh-pages
branch.
For the sake of this example, let’s pretend the subfolder containing your site is named dist
.
Make sure no other changes in master branch.
Remove the dist
directory from the project’s .gitignore
file. That mean original dist
is ignored in master branch.
Make sure git knows about your subtree (the subfolder with your site).
git add dist && git commit -m "Initial dist subtree commit"
Use subtree push to send it to the gh-pages
branch on GitHub.
git subtree push --prefix dist origin gh-pages
Boom. If your folder isn’t called dist
, then you’ll need to change that in each of the commands above.
If you do this on a regular basis, you could also create a script as following:
#!/bin/sh
if [ -z "$1" ]
then
echo "Which folder do you want to deploy to GitHub Pages?"
exit 1
fi
git add $1 && git commit -m "update dist folder as a subtree commit"
git subtree push --prefix $1 origin gh-pages
Run above shell as below:
# if file path is bin/git-deploy-gh-pages.sh
bash bin/git-deploy-gh-pages.sh dist
-
Run
bash bin/copy-sources-to-export.sh
to copy source folder to exoprt folder#!/bin/sh rm -rf export cp -r sources/. export
-
Remove gitignore for
export/
folder temporarily. -
Run
bash bin/git-deploy-gh-pages.sh export
git push origin
git subtree split --prefix dist master
:gh-pages --force
- git checkout master # you can avoid this line if you are in master...
- git subtree split --prefix dist -b gh-pages # create a local gh-pages branch containing the splitted output folder
- git push -f origin gh-pages:gh-pages # force the push of the gh-pages branch to the remote gh-pages branch at origin
- git branch -D gh-pages # delete the local gh-pages because you will need it: ref