From 810c43185b1d19b4189c50c365d898768955066c Mon Sep 17 00:00:00 2001 From: "Jocelyn Badgley (Twipped)" Date: Thu, 5 Mar 2020 19:41:32 -0800 Subject: [PATCH] Support tweets in metadata not having to be a list --- build/page.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/build/page.js b/build/page.js index 5e66041..cafbd0d 100644 --- a/build/page.js +++ b/build/page.js @@ -7,7 +7,7 @@ const File = require('./file'); const actions = require('./actions'); const { URL } = require('url'); const { resolve, readFile, isCleanUrl, ENGINE } = require('./resolve'); -const { isObject } = require('./lib/util'); +const { isObject, isString } = require('./lib/util'); const pkg = require(resolve('package.json')); const frontmatter = require('front-matter'); @@ -96,6 +96,7 @@ module.exports = exports = class Page extends File { this.ignore = this.meta.ignore; this.images = webready; this.titlecard = titlecard; + if (this.meta.tweets && isString(this.meta.tweets)) this.meta.tweets = this.meta.tweets.split(/\s/); this.tweets = (this.meta.tweets || []).map(parseTweetId); this.classes = Array.from(new Set(this.meta.classes || []));