Skip to content

Commit

Permalink
Merge pull request #1777 from jbnicolai/build-gh-pages-with-jekyll
Browse files Browse the repository at this point in the history
Build gh pages with jekyll
  • Loading branch information
Joshua Appelman committed Jul 5, 2015
2 parents bebb0b6 + ee695d9 commit 17b5374
Show file tree
Hide file tree
Showing 29 changed files with 1,134 additions and 6,211 deletions.
4 changes: 4 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
root = true

[*.md]
trim_trailing_whitespace = false
4 changes: 1 addition & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
.DS_Store
_site
node_modules
*.sock
testing
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
source 'https://rubygems.org'
gem 'github-pages'
131 changes: 131 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
GEM
remote: https://rubygems.org/
specs:
RedCloth (4.2.9)
activesupport (4.2.1)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
blankslate (2.1.2.4)
celluloid (0.16.0)
timers (~> 4.0.0)
classifier-reborn (2.0.3)
fast-stemmer (~> 1.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.9.1.1)
colorator (0.1)
execjs (2.5.2)
fast-stemmer (1.0.2)
ffi (1.9.8)
gemoji (2.1.0)
github-pages (37)
RedCloth (= 4.2.9)
github-pages-health-check (~> 0.2)
jekyll (= 2.4.0)
jekyll-coffeescript (= 1.0.1)
jekyll-feed (= 0.3.0)
jekyll-mentions (= 0.2.1)
jekyll-redirect-from (= 0.8.0)
jekyll-sass-converter (= 1.2.0)
jekyll-sitemap (= 0.8.1)
jemoji (= 0.4.0)
kramdown (= 1.5.0)
liquid (= 2.6.2)
maruku (= 0.7.0)
mercenary (~> 0.3)
pygments.rb (= 0.6.1)
rdiscount (= 2.1.7)
redcarpet (= 3.1.2)
terminal-table (~> 1.4)
github-pages-health-check (0.2.2)
net-dns (~> 0.6)
public_suffix (~> 1.4)
hitimes (1.2.2)
html-pipeline (1.9.0)
activesupport (>= 2)
nokogiri (~> 1.4)
i18n (0.7.0)
jekyll (2.4.0)
classifier-reborn (~> 2.0)
colorator (~> 0.1)
jekyll-coffeescript (~> 1.0)
jekyll-gist (~> 1.0)
jekyll-paginate (~> 1.0)
jekyll-sass-converter (~> 1.0)
jekyll-watch (~> 1.1)
kramdown (~> 1.3)
liquid (~> 2.6.1)
mercenary (~> 0.3.3)
pygments.rb (~> 0.6.0)
redcarpet (~> 3.1)
safe_yaml (~> 1.0)
toml (~> 0.1.0)
jekyll-coffeescript (1.0.1)
coffee-script (~> 2.2)
jekyll-feed (0.3.0)
jekyll-gist (1.2.1)
jekyll-mentions (0.2.1)
html-pipeline (~> 1.9.0)
jekyll (~> 2.0)
jekyll-paginate (1.1.0)
jekyll-redirect-from (0.8.0)
jekyll (>= 2.0)
jekyll-sass-converter (1.2.0)
sass (~> 3.2)
jekyll-sitemap (0.8.1)
jekyll-watch (1.2.1)
listen (~> 2.7)
jemoji (0.4.0)
gemoji (~> 2.0)
html-pipeline (~> 1.9)
jekyll (~> 2.0)
json (1.8.2)
kramdown (1.5.0)
liquid (2.6.2)
listen (2.10.0)
celluloid (~> 0.16.0)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
maruku (0.7.0)
mercenary (0.3.5)
mini_portile (0.6.2)
minitest (5.6.0)
net-dns (0.8.0)
nokogiri (1.6.6.2)
mini_portile (~> 0.6.0)
parslet (1.5.0)
blankslate (~> 2.0)
posix-spawn (0.3.11)
public_suffix (1.5.1)
pygments.rb (0.6.1)
posix-spawn (~> 0.3.6)
yajl-ruby (~> 1.2.0)
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rdiscount (2.1.7)
redcarpet (3.1.2)
safe_yaml (1.0.4)
sass (3.4.13)
terminal-table (1.4.5)
thread_safe (0.3.5)
timers (4.0.1)
hitimes
toml (0.1.2)
parslet (~> 1.5.0)
tzinfo (1.2.2)
thread_safe (~> 0.1)
yajl-ruby (1.2.1)

PLATFORMS
ruby

DEPENDENCIES
github-pages

BUNDLED WITH
1.10.5
19 changes: 12 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
PORT ?= 3000
bundle := bundle

index.html: head.html foot.html index.md
@markdown < index.md \
| cat head.html - foot.html \
> $@
start: toc bundle
${bundle} exec jekyll serve --safe --drafts --watch --port ${PORT}

clean:
rm -f index.html

.PHONY: clean
build: toc bundle
${bundle} exec jekyll build --safe

toc:
./node_modules/.bin/toc-idx -i index.md --max-depth 1 --bullet "\- " index.md

bundle:
${bundle}
50 changes: 17 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,29 @@
# mocha: How to Build the Site
# [mochajs.org](http://mochajs.org): How to Build the Site

So you wanna build the site?
*So you wanna build the site?*

## Requirements
[mochajs.org](http://mochajs.org) is now built using [Jekyll](http://jekyllrb.com), the popular static site generator.

There's two:
## Prerequisites

1. [make](http://www.gnu.org/software/make/)
2. [markdown](http://daringfireball.net/projects/markdown/)
1. Some recent version of Ruby
2. Some version of [RubyGems](https://rubygems.org)
3. Some recent version of Node.JS

### Mac OS X
## Installation

Install `markdown` via Homebrew:
1. Execute `npm install`. This will install [Bundler](http://bundler.io), Jekyll, and [markdown-toc-index](https://www.npmjs.com/package/markdown-toc-index).
2. To build, execute `npm run build` or `make build`

```sh
brew install markdown
```
## Local development

Or download from [here](http://daringfireball.net/projects/markdown/).
1. Run `make` to build the project and start a development server that auto-watches for changes on http://localhost:3000

Celebrate with tequila! Or try to build first. Probably want to build first.
For more information, refer to the [Jekyll Docs](http://jekyllrb.com/docs/home/) and [GitHub's Tutorial](https://help.github.com/articles/using-jekyll-with-pages/) on the subject.

### Linux
## Notes

#### Ubuntu 14.04

1. `sudo apt-get install build-essential` to install make.
2. `sudo apt-get install markdown` to install markdown.
3. That seems to do it. It's just a Perl script, so you can [get it from here](http://daringfireball.net/projects/markdown/) otherwise.

### Windows

*To be filled in by somebody using Windows*

## Building

Execute:

```
make clean && make
```

You should now have an updated `index.html`. Open it in your browser and proceed to tweak it until it's correct, because the compiler seem a little wonky.
- 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.

12 changes: 12 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
url: http://mochajs.org
markdown: redcarpet
redcarpet:
extensions: ["with_toc_data"]
highlighter: pygments
exclude:
- node_modules
- README.md
- Gemfile*
- package.json
- CNAME

3 changes: 3 additions & 0 deletions _includes/footer.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<footer>
<span>&copy; 2011 TJ Holowaychuk. All rights reserved. Licensed <a href="http://opensource.org/licenses/MIT" target="_blank">MIT</a></span>
</footer>
13 changes: 13 additions & 0 deletions _includes/head.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<head>
<meta charset="utf-8">
<title>{{ page.title }}</title>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.3.0/css/font-awesome.min.css"/>
<link rel="stylesheet" href="css/normalize.min.css"/>
<link rel="stylesheet" href="css/style.css"/>
<link rel="stylesheet" href="css/pygments.css"/>
<link rel="shortcut icon" href="favicon.ico"/>

<!--[if lt IE 9]>
<script src="//cdnjs.cloudflare.com/ajax/libs/html5shiv/3.7.2/html5shiv.min.js"></script>
<![endif]-->
</head>
7 changes: 7 additions & 0 deletions _includes/header.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<script>
window.onload = function () { window.document.body.classList.add('onload'); }
</script>
<header>
<h1><a href="http://mochajs.org/">Mocha</a></h1>
<p id="tag"><em>simple</em>, <em>flexible</em>, <em>fun</em></p>
</header>
18 changes: 18 additions & 0 deletions _layouts/default.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">

{% include head.html %}

<body>

{% include header.html %}

<section id="content">
{{ content }}
</section>

{% include footer.html %}

</body>

</html>
Loading

0 comments on commit 17b5374

Please sign in to comment.