Include rev manifest in posts output

This commit is contained in:
Jocelyn Badgley (Twipped) 2020-04-07 10:31:52 -07:00
parent 194bcaca38
commit dbce40d195
2 changed files with 8 additions and 3 deletions

View File

@ -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 };
}
};

View File

@ -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));
}