2022-08-14 15:55:13 +01:00
|
|
|
"use strict";
|
|
|
|
|
|
|
|
const path = require("path");
|
|
|
|
const fs = require("fs");
|
|
|
|
|
2022-08-14 19:34:56 +01:00
|
|
|
const shuffle = require("./lib/shuffle.js");
|
2022-08-27 23:36:09 +01:00
|
|
|
const fetch_github_user_info = require("./lib/fetch_github_user_info.js");
|
2022-08-14 15:55:13 +01:00
|
|
|
|
|
|
|
module.exports = async function() {
|
2022-09-04 16:31:31 +01:00
|
|
|
const author_names = new Set();
|
|
|
|
|
|
|
|
const feeds_data = JSON.parse(await fs.promises.readFile(path.resolve(__dirname, "../feeds.json"), "utf-8"))
|
|
|
|
.filter(feed_item => !author_names.has(feed_item.author_name) && author_names.add(feed_item.author_name));
|
|
|
|
|
2022-08-27 23:36:09 +01:00
|
|
|
await Promise.all(feeds_data.map(fetch_github_user_info));
|
2022-08-14 15:55:13 +01:00
|
|
|
|
2022-08-14 19:34:56 +01:00
|
|
|
shuffle(feeds_data); // Don't give any 1 person the advantage
|
|
|
|
|
2022-08-14 15:55:13 +01:00
|
|
|
return {
|
|
|
|
layout: "main.njk",
|
|
|
|
title: "Bloggers",
|
|
|
|
tags: "navigable",
|
|
|
|
date: "2001-01-01",
|
|
|
|
bloggers: feeds_data
|
|
|
|
}
|
|
|
|
}
|