From 0054ac2d803e5308778c5fd8219be41fe4459ac7 Mon Sep 17 00:00:00 2001 From: Florrie Date: Tue, 1 Jan 2019 02:14:51 -0400 Subject: New post, , post.config.unlisted --- build.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'build.js') diff --git a/build.js b/build.js index 2be227c..71e9b8a 100644 --- a/build.js +++ b/build.js @@ -481,7 +481,7 @@ const generateArchiveTable = posts => ( ${ - posts.map( + posts.filter(post => !post.config.unlisted).map( post => { const link = getPostPath(post) @@ -604,7 +604,7 @@ const parsePostText = async (text) => { }, attrs) return fixWS` -
+
${filename.match(/^[0-9]+-(.*)$/)[1]} ${options.noext ? '' : fixWS`
(${filename.match(/^[0-9]+-(.*)$/)[1]}.${options.ext}) @@ -691,10 +691,15 @@ const getCategoryData = () => ( ) const getLatestPost = posts => { - let latestPost = posts[0] + let latestPost = posts.find(post => !post.config.unlisted) let latestDate = 0 for (let curPost of posts) { + // If it's unlisted, skip it. + if (curPost.config.unlisted) { + continue + } + const curDate = getDate(curPost) if (curDate > latestDate) { latestPost = curPost -- cgit 1.3.0-6-gf8a5