Add meta.only form demo markdown file

This commit is contained in:
afc163 2015-11-10 15:40:30 +08:00
parent ac900e2919
commit 5c8f41556c

View File

@ -111,6 +111,17 @@ module.exports = function(nico) {
ret.push(post); ret.push(post);
} }
}); });
var hasOnly;
ret.forEach(function(post) {
if (post.meta.only) {
hasOnly = true;
}
});
if (hasOnly) {
ret = ret.filter(function(post) {
return post.meta.only;
});
}
ret = ret.sort(function(a, b) { ret = ret.sort(function(a, b) {
if (/index$/i.test(a.filename)) { if (/index$/i.test(a.filename)) {
a.meta.order = 1; a.meta.order = 1;