diff --git a/build/cache.js b/build/cache.js index 06e4682..c1af1a2 100644 --- a/build/cache.js +++ b/build/cache.js @@ -239,6 +239,8 @@ module.exports = exports = class Manifest { revManifest && fs.writeFile(resolve(REV_MANIFEST), JSON.stringify(revManifest, null, 2)), this.writeManifest(true), ]); + + return { revManifest: revManifest || {}, manifest: this.manifest }; } }; diff --git a/build/index.js b/build/index.js index d963199..216864b 100644 --- a/build/index.js +++ b/build/index.js @@ -42,9 +42,11 @@ exports.everything = function (prod = false) { // prime tweet data for all pages - const pages = await primeTweets(PublicFiles.pages.filter((p) => !p.meta.ignore)); + let pages = await primeTweets(PublicFiles.pages.filter((p) => !p.meta.ignore)); + pages = pages.filter(Boolean); let posts = await primeTweets(PostFiles.pages.filter((p) => !p.meta.ignore)); + posts = posts.filter(Boolean); posts = sortBy(posts, 'date'); posts.reverse(); @@ -68,10 +70,11 @@ exports.everything = function (prod = false) { const cache = new Cache({ prod }); await cache.load(); await evaluate(tasks.flat(), cache); - await cache.save(); + const { revManifest } = await cache.save(); const engines = await getEngines(prod); - const postIndex = await pageWriter(engines, pages, posts, prod); + const postIndex = await pageWriter(prod, engines, pages, posts); + postIndex.rev = revManifest; await fs.writeFile(resolve('dist/tweets/index.json'), prod ? JSON.stringify(postIndex) : JSON.stringify(postIndex, null, 2)); }