mirror of
https://github.com/jlengrand/coffeechat.git
synced 2026-03-10 08:11:20 +00:00
feat: add Mastodon Support (#37)
This commit is contained in:
@@ -141,6 +141,7 @@
|
||||
"languages": ["English", "Dutch", "Frisian"],
|
||||
"linkedin": "https://www.linkedin.com/in/wraldpyk/",
|
||||
"twitter": "https://twitter.com/wraldpyk",
|
||||
"mastodon": "https://fosstodon.org/@wraldpyk",
|
||||
"scheduling": "https://calendar.google.com/calendar/appointments/schedules/AcZssZ2j2HSqAeHfTXLKLdq5VyE-3lCrbIBLtL7DWAk6VrAkJfC5GVFEFI8cHAhUeIkbqFe1l3hmhm6A",
|
||||
"online-only": false,
|
||||
"topics": [
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
'use strict;'
|
||||
const fs = require('fs');
|
||||
const appRoot = require('app-root-path');
|
||||
let path = require('path');
|
||||
"use strict;";
|
||||
const fs = require("fs");
|
||||
const appRoot = require("app-root-path");
|
||||
let path = require("path");
|
||||
|
||||
//Get the data
|
||||
path = path.parse(appRoot.path);
|
||||
@@ -15,10 +15,26 @@ json.people.sort(function (a, b) {
|
||||
});
|
||||
|
||||
//Generate with proper formating
|
||||
const peopleList = json.people.map(people =>
|
||||
`- **[${people.name}](${people.scheduling}) (${(people.linkedin ? "[LinkedIn](" + people.linkedin + "), " : "")}${(people.twitter ? "[Twitter](" + people.twitter + ")" : "")}), ${people.title} at ${people.company}:** ${people.topics.join(', ')}`
|
||||
).join('\r\n');
|
||||
const peopleList = json.people
|
||||
.map(
|
||||
(person) => {
|
||||
let socials = [];
|
||||
['LinkedIn', 'Twitter', 'Mastodon'].forEach(social => {
|
||||
if (person.hasOwnProperty(social.toLowerCase()) && person[social.toLowerCase()].length > 0) {
|
||||
socials.push(`[${social}](${person[social.toLowerCase()]})`);
|
||||
}
|
||||
});
|
||||
|
||||
return `- **[${person.name}](${person.scheduling}) (${socials.join(', ')}), ${
|
||||
person.title
|
||||
} at ${person.company}:** ${person.topics.join(", ")}`
|
||||
}
|
||||
)
|
||||
.join("\r\n");
|
||||
|
||||
//Write README.md
|
||||
const template = fs.readFileSync(`${appRoot}/README-TEMPLATE.md`, 'utf8');
|
||||
fs.writeFileSync(`${parentFolderPath}/README.md`, template.replace('PLACEHOLDER', peopleList));
|
||||
const template = fs.readFileSync(`${appRoot}/README-TEMPLATE.md`, "utf8");
|
||||
fs.writeFileSync(
|
||||
`${parentFolderPath}/README.md`,
|
||||
template.replace("PLACEHOLDER", peopleList)
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user