Skip to content

Commit 0ca24ee

Browse files
committed
Merge branch 'master' of https://github.com/cramerdev/JavaScript-Garden into cramerdev-master
2 parents 6ca4789 + 7131d0b commit 0ca24ee

File tree

7 files changed

+68
-6
lines changed

7 files changed

+68
-6
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
/site/index.html
22
/build
33
/html
4+
/log
5+
/node_modules
46
/site/de
57
/site/ru
68
*.md~

build.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,5 +197,9 @@ var Garden = Class(function(options) {
197197
}
198198
});
199199

200-
new Garden({dir: 'doc', template: 'garden.jade', out: 'site'});
200+
exports.build = function (options) {
201+
options = options || {dir: 'doc', template: 'garden.jade', out: 'site'};
202+
new Garden(options);
203+
}
201204

205+
exports.build();

doc/en/index.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"articles": [
1010
"authors",
1111
"contributors",
12+
"hosting",
1213
"license"
1314
]
1415
},

doc/en/intro/hosting.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
## Hosting
2+
3+
[Cramer Development][1] bought the domain name and has donated hosting space for [JavaScriptGarden.info][2].
4+
5+
[1]: http://cramerdev.com/
6+
[2]: http://javascriptgarden.info/
7+

garden.jade

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ html(lang=language)
2626
- each lang in languages
2727
li(class=lang.id === language ? 'active' : '')
2828
- if (lang.id === baseLanguage)
29-
a(href= '/JavaScript-Garden/', title=lang.title) #{lang.id}
29+
a(href= '/', title=lang.title) #{lang.id}
3030

3131
- else
32-
a(href= '/JavaScript-Garden/' + lang.id, title=lang.title) #{lang.id}
32+
a(href= '/' + lang.id, title=lang.title) #{lang.id}
3333
a(id='top', href='#intro', title='Back to top') #top
3434
a(id='hide_menu', class='tablet') Hide Menu
3535

@@ -78,10 +78,13 @@ html(lang=language)
7878
footer
7979
p Copyright © 2011. Built with
8080
|
81-
a(href='http://nodejs.org/') Node.js
81+
a(href='http://nodejs.org/') Node.js
8282
| using a
83-
a(href='https://github.com/visionmedia/jade/') jade
84-
| template.
83+
a(href='https://github.com/visionmedia/jade/') jade
84+
| template.
85+
| Hosted by
86+
a(href='http://cramerdev.com') Cramer Development
87+
.
8588

8689
script(src='http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js')
8790

package.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
{
2+
"name": "javascript-garden",
3+
"description": "A collection of documentation about the most quirky parts of the JavaScript language.",
4+
"version": "0.0.0",
5+
"dependencies": {
6+
"fomatto": "0.5.0",
7+
"forever": "0.4.1",
8+
"jade": "0.9.1",
9+
"neko": "1.1.2",
10+
"node-markdown": "0.1.0"
11+
}
12+
}

server.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
// This server implements a post-receive hook handler for github that will build the site
2+
var build = require('./build').build,
3+
qs = require('querystring'),
4+
port = 9900,
5+
repoURL = "https://github.com/cramerdev/JavaScript-Garden";
6+
7+
require('http').createServer(function (request, response) {
8+
var payload = '';
9+
try {
10+
if (request.method === 'POST') {
11+
request.setEncoding('utf8');
12+
request.on('data', function (data) {
13+
payload += data;
14+
});
15+
request.on('end', function () {
16+
console.log(payload);
17+
payload = JSON.parse(qs.parse(payload).payload);
18+
if (payload.repository.url === repoURL) {
19+
build();
20+
} else {
21+
response.writeHead(400); // Bad Request
22+
}
23+
});
24+
response.writeHead(200); // OK
25+
} else {
26+
response.writeHead(405); // Method Not Allowed
27+
}
28+
} catch (e) {
29+
console.error("Error: " + e);
30+
response.writeHead(500); // Internal Server Error
31+
}
32+
response.end();
33+
}).listen(port);

0 commit comments

Comments
 (0)