I am trying to follow https://github.com/GitbookIO/gitbook but there is some assumed knowledge that clearly I don't have. I've used GitHub for some time but I've still got a lot to learn.
My goal is to have a GitHub page at http://martynchamberlin.github.io/GitBook/ that corresponds to this repository: https://github.com/martynchamberlin/GitBook.
So here's my question: how exactly is GitBook themselves doing this?
I assume (though it's not anywhere stated) that they are manually creating a gh-pages branch, because this magically turns a Github repo into a Github page.
To do this, I have followed the Github documentation at https://help.github.com/articles/creating-project-pages-manually
But here's my problem: all of the HTML (index.html, etc) is located at /_book/ instead of in the parent directory of the gh-pages branch. Which means that when I load https://github.com/martynchamberlin/GitBook, I'm getting a 404.
Note that when I run gitbook serve
locally, I see what I'm supposed to when I fire up my browser at localhost:4000.
I'm sure I'm missing something simple here. Any ideas?
Thanks, Martyn
for people who still have issues using the command above, here is my scenario.
I used to use
tortoise-git
on my windows machine to manage my github projects, and they are totally fine tool to use. But when it comes togitbook publish
command, it somehow stuck in the middle of switching between branches etc...My solution is to download the github windows client, and it has this
git shell
come with it , if you run thegitbook publish
command against the github suite git tooling, everything works fine.Regarding the
gh-pages
branch, you are correct, it can be found here:https://github.com/GitbookIO/git/tree/gh-pages
It does indeed have an
index.html
file in the root directory:https://github.com/GitbookIO/git/blob/gh-pages/index.html
Take a look at this book: https://github.com/GitbookIO/git.
It uses grunt to set up a few tasks: test, publish and build.
You should do the same by copying the package.json, Gruntfile.js and running:
For testing:
For publishing on the gh-pages branch: