From 88a97ada566732925b394e328de731c396305eac Mon Sep 17 00:00:00 2001 From: "Jocelyn Badgley (Twipped)" Date: Tue, 7 Apr 2020 10:36:09 -0700 Subject: [PATCH] Filter missing tweets --- build/page.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/build/page.js b/build/page.js index 33fffb0..8d1e819 100644 --- a/build/page.js +++ b/build/page.js @@ -94,7 +94,7 @@ module.exports = exports = class Page extends File { } this.source = body; - this.meta = meta; + this.meta = meta || {}; this.dateCreated = meta.date && new Date(meta.date) || ctime; this.dateModified = mtime; @@ -104,13 +104,13 @@ module.exports = exports = class Page extends File { } _parse (PublicFiles) { - const { titlecard, webready } = PublicFiles.for(this.dir); + const { titlecard, webready } = this.files = PublicFiles.for(this.dir); this.ignore = this.meta.ignore; this.draft = this.meta.draft; this.siblings = this.meta.siblings; this.images = webready; this.titlecard = titlecard; - if (this.meta.tweets && isString(this.meta.tweets)) this.meta.tweets = this.meta.tweets.split(/\s/); + if (this.meta.tweets && isString(this.meta.tweets)) this.meta.tweets = this.meta.tweets.split(/\s/).filter(Boolean); this.tweets = (this.meta.tweets || []).map(parseTweetId); this.classes = Array.from(new Set(this.meta.classes || []));