Skip to content

Commit

Permalink
Switch to Pug since Jade has been deprecated. (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
XhmikosR authored Aug 9, 2016
1 parent 6db65ea commit 6abf835
Show file tree
Hide file tree
Showing 17 changed files with 22 additions and 22 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ module.exports = function(grunt) {
tasks: ['less:development']
},
tmpl: {
files: 'src/tmpl/**/*.jade',
files: 'src/tmpl/**/*.pug',
tasks: ['default']
},
js: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@
"grunt-contrib-uglify": "~2.0.0",
"grunt-docs": "git://github.com/gruntjs/grunt-docs.git#371f7172dd3a14a50e0ae859e63826ad4ee46b38",
"highlight.js": "~9.5.0",
"jade": "~1.11.0",
"less-plugin-clean-css": "~1.5.1",
"lodash": "~4.14.2",
"marked": "https://github.com/vladikoff/marked/tarball/master",
"matchdep": "~1.0.1",
"method-override": "~2.3.5",
"node-schedule": "~1.1.0",
"pug": "~2.0.0-beta4",
"request": "~2.74.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion server.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ app.use(bodyParser.urlencoded({
}));
app.use(bodyParser.json());
app.set('views', path.join(__dirname, 'src', 'tmpl'));
app.set('view engine', 'jade');
app.set('view engine', 'pug');

// strip slashes
app.use(function (req, res, next) {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
18 changes: 9 additions & 9 deletions tasks/blog.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

module.exports = function (grunt) {

var jade = require('jade');
var pug = require('pug');
var highlighter = require('highlight.js');
var marked = require('marked');
var blog = require('./lib/blog').init(grunt);
Expand Down Expand Up @@ -69,7 +69,7 @@ module.exports = function (grunt) {

grunt.file.copy(src, dest, {
process: function (src) {
var file = 'src/tmpl/blog.jade';
var file = 'src/tmpl/blog.pug';
var templateData = {
page: 'news',
singlePost: true,
Expand All @@ -83,7 +83,7 @@ module.exports = function (grunt) {
};
shortList.push(templateData);

return jade.compile(grunt.file.read(file), {filename: file})(templateData);
return pug.compile(grunt.file.read(file), {filename: file})(templateData);
}
});
});
Expand All @@ -100,8 +100,8 @@ module.exports = function (grunt) {
shortList.forEach(function (item) {
item.content = marked(item.rawSrc);
});
var blogTpl = 'src/tmpl/blog.jade';
var blogOut = jade.compile(grunt.file.read(blogTpl), {filename: blogTpl})({
var blogTpl = 'src/tmpl/blog.pug';
var blogOut = pug.compile(grunt.file.read(blogTpl), {filename: blogTpl})({
page: 'blog',
title: 'The Grunt Blog',
content: shortList,
Expand All @@ -122,8 +122,8 @@ module.exports = function (grunt) {
item.rssSrc = marked(item.rawSrc);
item.atomId = blog.atomIDnTimeStampChurner(item.url, item.postRawDate);
});
var rssTpl = 'src/tmpl/rss.jade';
var rssOut = jade.compile(grunt.file.read(rssTpl), {filename: rssTpl})({
var rssTpl = 'src/tmpl/rss.pug';
var rssOut = pug.compile(grunt.file.read(rssTpl), {filename: rssTpl})({
page: 'rss',
posts: shortList
});
Expand All @@ -133,8 +133,8 @@ module.exports = function (grunt) {
* Generate the front page
*/
grunt.log.ok('Generating the front page...');
var indexTpl = 'src/tmpl/index.jade';
var indexOut = jade.compile(grunt.file.read(indexTpl), {filename: indexTpl})({
var indexTpl = 'src/tmpl/index.pug';
var indexOut = pug.compile(grunt.file.read(indexTpl), {filename: indexTpl})({
page: 'index',
news: shortList.splice(0, 5)
});
Expand Down
14 changes: 7 additions & 7 deletions tasks/docs.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
module.exports = function (grunt) {

var fs = require('fs');
var jade = require('jade');
var pug = require('pug');
var highlighter = require('highlight.js');
var docs = require('./lib/docs').init(grunt);
var marked = require('marked');
Expand Down Expand Up @@ -104,7 +104,7 @@ module.exports = function (grunt) {
grunt.file.copy(src, dest, {
process: function (src) {
try {
var file = 'src/tmpl/docs.jade';
var file = 'src/tmpl/docs.pug';
var templateData = {
page: 'docs',
rootSidebar: true,
Expand All @@ -113,10 +113,10 @@ module.exports = function (grunt) {
content: docs.anchorFilter(marked(docs.wikiAnchors(src))),
sidebars: sidebars
};
return jade.compile(grunt.file.read(file), {filename: file})(templateData);
return pug.compile(grunt.file.read(file), {filename: file})(templateData);
} catch (e) {
grunt.log.error(e);
grunt.fail.warn('Jade failed to compile.');
grunt.fail.warn('Pug failed to compile.');
}
}
});
Expand Down Expand Up @@ -154,7 +154,7 @@ module.exports = function (grunt) {
grunt.file.copy(src, dest, {
process: function (src) {
try {
var file = 'src/tmpl/docs.jade';
var file = 'src/tmpl/docs.pug';
var templateData = {
page: 'api',
pageSegment: name.toLowerCase(),
Expand All @@ -163,10 +163,10 @@ module.exports = function (grunt) {
sidebars: sidebars
};

return jade.compile(grunt.file.read(file), {filename: file})(templateData);
return pug.compile(grunt.file.read(file), {filename: file})(templateData);
} catch (e) {
grunt.log.error(e);
grunt.fail.warn('Jade failed to compile.');
grunt.fail.warn('Pug failed to compile.');
}
}
});
Expand Down
6 changes: 3 additions & 3 deletions tasks/plugins.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@

module.exports = function (grunt) {

var jade = require('jade');
var pug = require('pug');
var marked = require('marked');
var plugins = require('../grunt-plugins');

/**
* Custom task to generate the plugins page
*/
grunt.registerTask('plugins', 'Compile Grunt Plugins Page', function () {
var pluginTpl = 'src/tmpl/plugins.jade';
var pluginTpl = 'src/tmpl/plugins.pug';
var base = 'node_modules/grunt-docs/';

// Set default marked options
Expand All @@ -29,7 +29,7 @@ module.exports = function (grunt) {
});

grunt.log.ok('Generating plugins page...');
var output = jade.compile(grunt.file.read(pluginTpl), {filename: pluginTpl})({
var output = pug.compile(grunt.file.read(pluginTpl), {filename: pluginTpl})({
page: 'plugins',
title: 'Plugins',
content: marked(grunt.file.read(base + 'Grunt-Plugins.md'))
Expand Down

0 comments on commit 6abf835

Please sign in to comment.