Skip to content

Commit

Permalink
1.0.8 release
Browse files Browse the repository at this point in the history
  • Loading branch information
tommy351 committed Mar 28, 2013
2 parents 92b4e68 + 6e074f2 commit 6f7d0c0
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 7 deletions.
10 changes: 9 additions & 1 deletion lib/plugins/helper/css.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
var extend = require('../../extend');

extend.helper.register('css', function(path){
return '<link rel="stylesheet" href="' + path + '" type="text/css">';
if (!Array.isArray) path = [path];

var result = [];

path.forEach(function(item){
result.push('<link rel="stylesheet" href="' + item + '" type="text/css">');
});

return result.join('\n');
});
1 change: 1 addition & 0 deletions lib/plugins/helper/index.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require('./css');
require('./js');
require('./markdown');
require('./trim');
require('./strip');
require('./partial');
Expand Down
10 changes: 9 additions & 1 deletion lib/plugins/helper/js.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
var extend = require('../../extend');

extend.helper.register('js', function(path){
return '<script type="text/javascript" src="' + path + '"></script>';
if (!Array.isArray) path = [path];

var result = [];

path.forEach(function(item){
result.push('<script type="text/javascript" src="' + item + '"></script>');
});

return result.join('\n');
});
6 changes: 6 additions & 0 deletions lib/plugins/helper/markdown.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var extend = require('../../extend'),
renderSync = require('../../render').renderSync;

extend.helper.register('markdown', function(text){
return renderSync({text: text, engine: 'markdown'});
});
8 changes: 6 additions & 2 deletions lib/plugins/processor/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,11 @@ extend.processor.register(/^_posts\/([^_](?:(?!\/_).)*)$/, function(file, callba
}

if (!meta.date){
meta.date = info ? new Date(info.year, info.month - 1, info.day) : stat.ctime;
if (info && info.year && info.month && info.day){
meta.date = new Date(info.year, info.month - 1, info.day);
} else {
meta.date = stat.ctime;
}
}
}

Expand Down Expand Up @@ -475,4 +479,4 @@ hexo.on('processAfter', function(){
dbTags.findRaw({posts: {$in: id}}).update({posts: {$pull: id}});
}
});
});
});
8 changes: 8 additions & 0 deletions lib/plugins/renderer/html.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var extend = require('../../extend');

var process_html = function(data) {
return data.text;
};

extend.renderer.register('html', 'html', process_html, true);
extend.renderer.register('htm', 'html', process_html, true);
3 changes: 2 additions & 1 deletion lib/plugins/renderer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ require('./ejs');
require('./markdown');
require('./stylus');
require('./swig');
require('./yaml');
require('./yaml');
require('./html');
2 changes: 1 addition & 1 deletion lib/plugins/tag/blockquote.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ var blockquote = function(args, content){
}
}

return '<blockquote>' + content + (footer ? '<footer>' + footer + '</footer>' : '') + '</blockquote>';
return '<blockquote>' + renderSync({text: content, engine: 'markdown'}) + (footer ? '<footer>' + footer + '</footer>' : '') + '</blockquote>';
};

extend.tag.register('quote', blockquote, true);
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "hexo",
"version": "1.0.7",
"version": "1.0.8",
"description": "A fast, simple & powerful blog framework, powered by Node.js.",
"preferGlobal": true,
"bin": {
Expand Down

0 comments on commit 6f7d0c0

Please sign in to comment.