mirror of
https://github.com/GenderDysphoria/GenderDysphoria.fyi.git
synced 2025-01-31 07:16:17 +00:00
Sort posts before reversing, filter ignored
This commit is contained in:
parent
e6f12453b8
commit
13c149c9e0
@ -6,6 +6,7 @@ const loadPostFiles = require('./posts');
|
||||
const Cache = require('./cache');
|
||||
const Promise = require('bluebird');
|
||||
const fs = require('fs-extra');
|
||||
const { sortBy } = require('lodash');
|
||||
|
||||
const primeTweets = require('./page-tweets');
|
||||
const pageWriter = require('./page-writer');
|
||||
@ -36,9 +37,10 @@ exports.everything = function (prod = false) {
|
||||
|
||||
|
||||
// prime tweet data for all pages
|
||||
const pages = await primeTweets(PublicFiles.pages);
|
||||
const posts = await primeTweets(PostFiles.pages);
|
||||
const pages = await primeTweets(PublicFiles.pages.filter((p) => !p.meta.ignore));
|
||||
|
||||
let posts = await primeTweets(PostFiles.pages.filter((p) => !p.meta.ignore));
|
||||
posts = sortBy(posts, 'date');
|
||||
posts.reverse();
|
||||
|
||||
// compile all tasks to be completed
|
||||
|
@ -93,6 +93,7 @@ module.exports = exports = class Page extends File {
|
||||
_parse (PublicFiles) {
|
||||
const { titlecard, webready } = PublicFiles.for(this.dir);
|
||||
|
||||
this.ignore = this.meta.ignore;
|
||||
this.images = webready;
|
||||
this.titlecard = titlecard;
|
||||
this.tweets = (this.meta.tweets || []).map(parseTweetId);
|
||||
|
Loading…
x
Reference in New Issue
Block a user