难以获得GitBook网站显示在GitHub页面 [英] Difficulty in getting GitBook site to show up in GitHub page
问题描述
我尝试关注 https://github.com/GitbookIO/gitbook ,但有一些假设知识,显然我没有。我使用GitHub一段时间,但我还有很多要学习。
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.
我的目标是拥有一个 GitHub网页与此存储库对应的 http://martynchamberlin.github.io/GitBook/ : https://github.com/martynchamberlin/GitBook 。
My goal is to have a GitHub page at http://martynchamberlin.github.io/GitBook/ that corresponds to this repository: https://github.com/martynchamberlin/GitBook.
这里是我的问题: GitBook本身是怎么做的?
So here's my question: how exactly is GitBook themselves doing this?
我假设(虽然没有任何声明),他们手动创建一个gh页面分支,因为这神奇地将一个Github repo变成一个Github页面。
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.
为了做到这一点,我遵循了 https://help.github.com/articles/creating-project-pages-manually
To do this, I have followed the Github documentation at https://help.github.com/articles/creating-project-pages-manually
但这里是我的问题:所有的HTML(index.html,etc)位于/ _book /而不是在gh-pages分支的父目录中。这意味着,当我加载 https://github.com/martynchamberlin/GitBook 时,我收到404.
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.
请注意,当我在本地运行 gitbook serve
时,我看到了我的火up我的浏览器在localhost:4000。
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?
感谢,
Martyn
Thanks, Martyn
推荐答案
请查看此书: https://github.com/GitbookIO/git 。
它使用grunt来设置一些任务:测试,发布和构建。
It uses grunt to set up a few tasks: test, publish and build.
您应该通过复制package.json,Gruntfile .js并运行:
You should do the same by copying the package.json, Gruntfile.js and running:
$ npm install .
测试:
$ grunt test
要在gh-pages分支上发布:
For publishing on the gh-pages branch:
$ grunt publish
这篇关于难以获得GitBook网站显示在GitHub页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!