1
0
mirror of https://github.com/GenderDysphoria/GenderDysphoria.fyi.git synced 2025-11-25 20:42:40 +00:00

Write out a post index into /tweets/index.json. Write out assets for debugging.

This commit is contained in:
Jocelyn Badgley (Twipped)
2020-03-06 19:36:09 -08:00
parent 92a982eeb8
commit bbf0b2feed
6 changed files with 45 additions and 13 deletions

View File

@@ -9,6 +9,12 @@ const pkg = require(resolve('package.json'));
const postmatch = /(\d{4}-\d\d-\d\d)\.\d{4}\.(\w+)/;
function arrayify (input) {
if (!input) return [];
if (!Array.isArray(input)) return [ input ];
return input;
}
module.exports = exports = class Post extends Page {
_dir (dir) {
@@ -60,6 +66,8 @@ module.exports = exports = class Post extends Page {
return result;
}, {});
this.meta.author = this.meta.author && arrayify(this.meta.author) || [];
this.classes.push('post');
}