diff --git a/gulpfile.js b/gulpfile.js index 612c69f..2be56bb 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -404,6 +404,8 @@ function createFeeds() { } }); const posts = fs.readdirSync(path.join(paths.out, 'posts')); + // Remove the template, that doesn't need to be included + posts.splice(posts.indexOf('template.html'), 1); // Sort the posts descending year and month posts.sort((a, b) => { const yearA = Number(a.replace(/\D/g, '')); @@ -416,12 +418,8 @@ function createFeeds() { return yearB - yearA; }); - for (const post of posts) { - // Skip the template, that doesn't need to be included - if (post.includes('template')) { - continue; - } - + for (let i = 0; i < 5; i++) { + const post = posts[i]; const html = fs.readFileSync(path.join(paths.out, 'posts', post), 'UTF8'); const $ = cheerio.load(html); const title = $('#wrapper>h1').text();