mirror of
https://github.com/GenderDysphoria/GenderDysphoria.fyi.git
synced 2025-01-31 07:16:17 +00:00
Support tweets in metadata not having to be a list
This commit is contained in:
parent
13c149c9e0
commit
810c43185b
@ -7,7 +7,7 @@ const File = require('./file');
|
|||||||
const actions = require('./actions');
|
const actions = require('./actions');
|
||||||
const { URL } = require('url');
|
const { URL } = require('url');
|
||||||
const { resolve, readFile, isCleanUrl, ENGINE } = require('./resolve');
|
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 pkg = require(resolve('package.json'));
|
||||||
const frontmatter = require('front-matter');
|
const frontmatter = require('front-matter');
|
||||||
@ -96,6 +96,7 @@ module.exports = exports = class Page extends File {
|
|||||||
this.ignore = this.meta.ignore;
|
this.ignore = this.meta.ignore;
|
||||||
this.images = webready;
|
this.images = webready;
|
||||||
this.titlecard = titlecard;
|
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.tweets = (this.meta.tweets || []).map(parseTweetId);
|
||||||
|
|
||||||
this.classes = Array.from(new Set(this.meta.classes || []));
|
this.classes = Array.from(new Set(this.meta.classes || []));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user