Skip to content

Commit ce0c709

Browse files
committed
Add regular jade views
1 parent 70a9d9f commit ce0c709

File tree

3 files changed

+8
-17
lines changed

3 files changed

+8
-17
lines changed

Gruntfile.js

+1-15
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,6 @@ module.exports = function(grunt) {
5555
}
5656
},
5757

58-
jade: {
59-
notfound: {
60-
options: {
61-
data: {
62-
page: 'notfound',
63-
title: '404 Not Found'
64-
}
65-
},
66-
files: {
67-
'build/404.html': 'src/tmpl/404.jade'
68-
}
69-
}
70-
},
71-
7258
uglify: {
7359
plugins: {
7460
src: [
@@ -135,7 +121,7 @@ module.exports = function(grunt) {
135121
grunt.loadTasks('tasks'); // getWiki, docs tasks
136122
require('matchdep').filterAll(['grunt-*', '!grunt-cli', '!grunt-docs']).forEach(grunt.loadNpmTasks);
137123

138-
grunt.registerTask('build', 'Build the site', ['copy', 'jade', 'docs', 'blog', 'plugins', 'uglify']);
124+
grunt.registerTask('build', 'Build the site', ['copy', 'docs', 'blog', 'plugins', 'uglify']);
139125
grunt.registerTask('default', 'Build the site, download plugins, production ready', ['build', 'downloadPlugins', 'less:production']);
140126
grunt.registerTask('dev', 'Development Mode', ['build', 'less:development', 'jshint', 'concurrent']);
141127
};

package.json

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"grunt-contrib-uglify": "~0.3.3",
3030
"grunt-contrib-copy": "~0.4.1",
3131
"grunt-contrib-less": "~0.5.2",
32-
"grunt-contrib-jade": "~0.5.1",
3332
"marked": "https://github.com/vladikoff/marked/tarball/master",
3433
"highlight.js": "~7.3.0",
3534
"lodash": "~1.0.1",

server.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
var express = require('express');
22
var app = express();
33
var fs = require('fs');
4+
var path = require('path');
45
var schedule = require('node-schedule');
56

67
schedule.scheduleJob('0 0 * * *', function(){
@@ -23,6 +24,8 @@ app.configure(function () {
2324
app.use(express.compress());
2425
app.use(express.methodOverride());
2526
app.use(express.bodyParser());
27+
app.set('views', path.join(__dirname, 'src', 'tmpl'));
28+
app.set('view engine', 'jade');
2629

2730
// strip slashes
2831
app.use(function (req, res, next) {
@@ -38,7 +41,10 @@ app.configure(function () {
3841
app.use(express.static('build'));
3942
// if nothing matched, send 404
4043
app.use(function (req, res) {
41-
res.status(404).sendfile('build/404.html');
44+
res.status(404).render('404', {
45+
page: 'notfound',
46+
title: '404 Not Found'
47+
});
4248
});
4349
app.use(express.errorHandler({
4450
dumpExceptions:false,

0 commit comments

Comments
 (0)