Skip to content

Commit 6f7d0c0

Browse files
committed
1.0.8 release
2 parents 92b4e68 + 6e074f2 commit 6f7d0c0

File tree

9 files changed

+43
-7
lines changed

9 files changed

+43
-7
lines changed

lib/plugins/helper/css.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
var extend = require('../../extend');
22

33
extend.helper.register('css', function(path){
4-
return '<link rel="stylesheet" href="' + path + '" type="text/css">';
4+
if (!Array.isArray) path = [path];
5+
6+
var result = [];
7+
8+
path.forEach(function(item){
9+
result.push('<link rel="stylesheet" href="' + item + '" type="text/css">');
10+
});
11+
12+
return result.join('\n');
513
});

lib/plugins/helper/index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
require('./css');
22
require('./js');
3+
require('./markdown');
34
require('./trim');
45
require('./strip');
56
require('./partial');

lib/plugins/helper/js.js

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
var extend = require('../../extend');
22

33
extend.helper.register('js', function(path){
4-
return '<script type="text/javascript" src="' + path + '"></script>';
4+
if (!Array.isArray) path = [path];
5+
6+
var result = [];
7+
8+
path.forEach(function(item){
9+
result.push('<script type="text/javascript" src="' + item + '"></script>');
10+
});
11+
12+
return result.join('\n');
513
});

lib/plugins/helper/markdown.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
var extend = require('../../extend'),
2+
renderSync = require('../../render').renderSync;
3+
4+
extend.helper.register('markdown', function(text){
5+
return renderSync({text: text, engine: 'markdown'});
6+
});

lib/plugins/processor/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,11 @@ extend.processor.register(/^_posts\/([^_](?:(?!\/_).)*)$/, function(file, callba
290290
}
291291

292292
if (!meta.date){
293-
meta.date = info ? new Date(info.year, info.month - 1, info.day) : stat.ctime;
293+
if (info && info.year && info.month && info.day){
294+
meta.date = new Date(info.year, info.month - 1, info.day);
295+
} else {
296+
meta.date = stat.ctime;
297+
}
294298
}
295299
}
296300

@@ -475,4 +479,4 @@ hexo.on('processAfter', function(){
475479
dbTags.findRaw({posts: {$in: id}}).update({posts: {$pull: id}});
476480
}
477481
});
478-
});
482+
});

lib/plugins/renderer/html.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
var extend = require('../../extend');
2+
3+
var process_html = function(data) {
4+
return data.text;
5+
};
6+
7+
extend.renderer.register('html', 'html', process_html, true);
8+
extend.renderer.register('htm', 'html', process_html, true);

lib/plugins/renderer/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ require('./ejs');
22
require('./markdown');
33
require('./stylus');
44
require('./swig');
5-
require('./yaml');
5+
require('./yaml');
6+
require('./html');

lib/plugins/tag/blockquote.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ var blockquote = function(args, content){
5757
}
5858
}
5959

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

6363
extend.tag.register('quote', blockquote, true);

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "hexo",
3-
"version": "1.0.7",
3+
"version": "1.0.8",
44
"description": "A fast, simple & powerful blog framework, powered by Node.js.",
55
"preferGlobal": true,
66
"bin": {

0 commit comments

Comments
 (0)