Skeleton to build a GitBook and Deploy it to GitHub Pages
Skeleton to build a book with gitbook and deploy it to GitHub pages
Instrucciones para los autores
Assume you want to create a book inside the Github organization
my-organization
with name my-repo
. Follow these steps:
- Install git
- Install NodeJS
- Install gulp globally:
npm i -g gulp
Install gitbook in your computer
Install
gitbook-cli
:npm i -g gitbook-cli
- Join GitHub
- Install hub (optional)
- The skeleton of the book is hosted in this repo: https://github.com/etsiiull/gitbook-skeleton
- Fork or clone this repo
hub clone etsiiull/gitbook-skeleton my-repo
- Alternatively, clone the book in your machine using:
git clone https://github.com/etsiiull/gitbook-skeleton.git
- Fork or clone this repo
- Modify the files
gulpfile.js
andpackage.json
- Substitute all the appearances of
etsiiull
bymy-organization
ingulpfile.js
, - Substitute all the appearances of
gitbook-skeleton
bymy-repo
ingulpfile.js
,package.json
- Change the
name
,description
, author,
keywords, etc. in
package.json`
- Substitute all the appearances of
- Remove the
origin
remote:git remote rm origin
- Or alternatively rename the remote
git remote rename origin etsiiull
- Or alternatively rename the remote
- Create the new repo in GitHub:
hub create my-organization/my-repo
[~/TFGsrc/my-repo(master)]$ git remote -v origin https://github.com/my-organization/my-repo.git (fetch) origin https://github.com/my-organization/my-repo.git (push)
- In GitHub go to the settings of the new repo and set the
master
branch as the branch for GitHub pages - Run
gitbook install
to install plugins from registry. - Install the dependencies of this book/project
npm i
- Write in markdown the contents of your book
- Compile the book with
gulp build
to produce the HTML - To deploy your book in GitHub write
gulp deploy
- Visit https://my-repo.github.io to see the result
- For more details see the section Markdown and GitBook