Skip to content

Commit c104d6e

Browse files
committed
added assets, views, and updated routes
1 parent 4a672d8 commit c104d6e

File tree

189 files changed

+54819
-1
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

189 files changed

+54819
-1
lines changed

app.js

+24
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,30 @@ app.configure('production', function(){
3737
app.get('/', function(req, res){
3838
res.render("index.html");
3939
});
40+
app.get('/index.html', function(req, res){
41+
res.render("index.html");
42+
});
43+
app.get('/scaffolding.html', function(req, res){
44+
res.render("scaffolding.html");
45+
});
46+
app.get('/base-css.html', function(req, res){
47+
res.render("base-css.html");
48+
});
49+
app.get('/components.html', function(req, res){
50+
res.render("components.html");
51+
});
52+
app.get('/javascript.html', function(req, res){
53+
res.render("javascript.html");
54+
});
55+
app.get('/less.html', function(req, res){
56+
res.render("less.html");
57+
});
58+
app.get('/download.html', function(req, res){
59+
res.render("download.html");
60+
});
61+
app.get('/examples.html', function(req, res){
62+
res.render("examples.html");
63+
});
4064

4165
app.listen(process.env.PORT || 3000);
4266
console.log("Express server listening on port %d in %s mode", app.address().port, app.settings.env);

build/index.js

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env node
2+
var hogan = require('hogan.js')
3+
, fs = require('fs')
4+
, prod = process.argv[2] == 'production'
5+
, title = 'Twitter Bootstrap'
6+
7+
var layout, pages
8+
9+
// compile layout template
10+
layout = fs.readFileSync(__dirname + '/../templates/layout.mustache', 'utf-8')
11+
layout = hogan.compile(layout, { sectionTags: [{o:'_i', c:'i'}] })
12+
13+
// retrieve pages
14+
pages = fs.readdirSync(__dirname + '/../templates/pages')
15+
16+
// iterate over pages
17+
pages.forEach(function (name) {
18+
19+
if (!name.match(/\.mustache$/)) return
20+
21+
var page = fs.readFileSync(__dirname + '/../templates/pages/' + name, 'utf-8')
22+
, context = {}
23+
24+
context[name.replace(/\.mustache$/, '')] = 'active'
25+
context._i = true
26+
context.production = prod
27+
context.title = name
28+
.replace(/\.mustache/, '')
29+
.replace(/\-.*/, '')
30+
.replace(/(.)/, function ($1) { return $1.toUpperCase() })
31+
32+
if (context.title == 'Index') {
33+
context.title = title
34+
} else {
35+
context.title += ' · ' + title
36+
}
37+
38+
page = hogan.compile(page, { sectionTags: [{o:'_i', c:'i'}] })
39+
page = layout.render(context, {
40+
body: page
41+
})
42+
43+
fs.writeFileSync(__dirname + '/../' + name.replace(/mustache$/, 'html'), page, 'utf-8')
44+
})

build/package.json

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"name": "bootstrap-doc-builder"
3+
, "version": "0.0.1"
4+
, "description": "build bootstrap docs"
5+
, "dependencies": { "hogan.js": "1.0.5-dev" }
6+
}

public/.DS_Store

6 KB
Binary file not shown.

public/assets/bootstrap.zip

54.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)