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.jsandpackage.json- Substitute all the appearances of
etsiiullbymy-organizationingulpfile.js, - Substitute all the appearances of
gitbook-skeletonbymy-repoingulpfile.js,package.json - Change the
name,description, author,keywords, etc. inpackage.json`
- Substitute all the appearances of
- Remove the
originremote: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
masterbranch as the branch for GitHub pages - Run
gitbook installto 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 buildto 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