mochajs.org: How to Build the Site
So you wanna build the site?
mochajs.org is now built using Jekyll, the popular static site generator.
Prerequisites
- Some recent version of Ruby
- Some version of RubyGems
- Some recent version of Node.JS
Installation
- Execute
npm install
. This will install Bundler, Jekyll, and markdown-toc-index. - To build, execute
npm run build
ormake build
Problems?
Permissions-Related
If npm install
fails due to an EACCESS
problem, try this:
$ sudo gem install bundler
$ npm install --ignore-scripts
$ bundle install
Ruby-Related on OS X
You may need to install the Xcode command line tools if bundle install
fails somewhere. Execute this:
$ xcode-select --install
Local development
- Run
make
to build the project and start a development server that auto-watches for changes on http://localhost:3000
For more information, refer to the Jekyll Docs and GitHub's Tutorial on the subject.
Notes
- To update
index.md
with the TOC, execute:node_modules/.bin/toc-idx -i index.md --max-depth 1 --bullet "\- " index.md
bundle exec jekyll build
rebuilds the site without updating the TOC- The
_site
directory is where the generated site lives. It is not under version control, because GitHub Pages generates it for us.