From 5c8f41556cfef61a31770ece6bdf881a82a0839b Mon Sep 17 00:00:00 2001 From: afc163 Date: Tue, 10 Nov 2015 15:40:30 +0800 Subject: [PATCH] Add meta.only form demo markdown file --- site/theme.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/site/theme.js b/site/theme.js index 4ae448c4dd..8d79664229 100644 --- a/site/theme.js +++ b/site/theme.js @@ -111,6 +111,17 @@ module.exports = function(nico) { 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) { if (/index$/i.test(a.filename)) { a.meta.order = 1;