Sets up a repo after initial generation of Github pages and adds a hook for syncing after initial creation from GitHub.
These couple of shell scripts use curl
, git
, perl
and shell
commands. They should be in any basic Linux or Mac installation that
is already using GitHub, but if it's not, sudo apt-get install curl perl
and whatever else is not there.
- Generate GitHub pages though the web interface.
git pull
.- Download and run
setup.sh
and save it as.git/hooks/post-commit
or do directly
curl -L https://raw.githubusercontent.com/JJ/setup-gh-pages/master/setup.sh | bash
which will do the same for you.
Finally, edit your README.md
and commit to check the post-commit
synchronization hook; push to publish the new version of the file.
If your project includes other files, you'll have to adapt the hook script.
I have tested it on all templates as of December 2014. It might not
work for some new, or custom, templates, since everyone uses different
elements to include the content. If so, you'll have to go and edit
_layouts/index.html
and insert by hand {{ "{{" }}content}}
where
you want your content to go. But please leave an issue in this repo
and I'll try to fix it, with a sample of the index.html
that
generated it.
It follows instructions in
this StackOverflow
question to set up gh-pages and then adds a script,
sync.sh
, as a post-commit hook in the .git/hooks
directory.