Update participants

This commit is contained in:
Dennis Reimann
2025-01-18 14:13:32 +01:00
parent 938a2ce9d6
commit f4bb3bd737
60 changed files with 116 additions and 68 deletions

View File

@@ -1,8 +1,8 @@
const { writeFileSync } = require('fs')
const { join, resolve } = require('path')
const { replacements, slugify, stripHTML, teamWithAliases, participantToId } = require('../helpers')
const { replacements, slugify, stripHTML, participantsWithAliases, participantToId } = require('../helpers')
const { masterFeedUrl, publicFeedUrl, nodeId } = require('../content/meta.json')
const teamRaw = require('../content/team.json')
const participantsRaw = require('../content/participants.json')
const request = require('sync-request')
const { XMLParser, XMLBuilder, XMLValidator } = require('fast-xml-parser')
const xmlFormat = require('xml-formatter')
@@ -13,7 +13,7 @@ const write = (name, data) => writeFileSync(join(dir, name), data)
const writeJSON = (name, data) =>
write(`generated/${name}.json`, JSON.stringify(data, null, 2))
const team = teamWithAliases(teamRaw)
const participants = participantsWithAliases(participantsRaw)
const commonOpts = {
attributeNamePrefix: '',
@@ -166,7 +166,7 @@ const parseEpisode = e => {
const value = episode.participants.reduce((result, name) => {
const id = participantToId(name)
const v4v = team[id] && team[id].v4v
const v4v = participants[id] && participants[id].v4v
if (v4v) {
result.push({ name, ...v4v })
} else if (debug) {
@@ -195,7 +195,7 @@ const parseEpisode = e => {
const people = episode.participants.reduce((result, name) => {
const id = participantToId(name)
const person = team[id]
const person = participants[id]
if (person) {
result.push(person)
}

View File

@@ -1,7 +1,7 @@
const { mkdirSync, writeFileSync } = require('fs')
const { dirname, resolve } = require('path')
const { NDKUser } = require('@nostr-dev-kit/ndk')
const team = require('../content/team.json')
const participants = require('../content/participants.json')
const { npub } = require('../content/meta.json')
const einundzwanzig = new NDKUser({ npub: npub.einundzwanzig })
@@ -19,7 +19,7 @@ const relays = {
]
}
Object.entries(team).forEach(([key, { nostr: npub }]) => {
Object.entries(participants).forEach(([key, { nostr: npub }]) => {
if (!npub) return
const id = key.replace(/[\s]/g, '_')
names[id] = new NDKUser({ npub }).pubkey

View File

@@ -1,13 +1,13 @@
const pug = require('pug')
const { mkdirSync, writeFileSync } = require('fs')
const { dirname, resolve } = require('path')
const { slugify, teamWithAliases, participantToId } = require('../helpers')
const { slugify, participantsWithAliases, participantToId } = require('../helpers')
const config = require('../pug.config')
const site = require('../generated/site-data.json')
const episodes = require('../generated/episodes.json')
const spendenregister = require('../generated/spendenregister.json')
const spendenuebersicht = require('../content/spendenuebersicht.json').reverse()
const teamRaw = require('../content/team.json')
const participantsRaw = require('../content/participants.json')
const shops = require('../content/shops.json')
const soundboard = require('../content/soundboard.json')
const adventskalender = require('../content/adventskalender-2022.json')
@@ -23,7 +23,7 @@ const categories = {
'verschiedenes': 'Verschiedenes'
}
const team = teamWithAliases(teamRaw)
const participants = participantsWithAliases(participantsRaw)
const changedFile = process.argv.length > 2 && process.argv[2]
@@ -44,8 +44,8 @@ const renderPage = (template, out, data = {}) => {
writeFileSync(dst, rendered)
}
renderPage('index', 'index', { navCurrent: 'index', currentEpisode: episodes[0], team })
renderPage('podcast', 'podcast', { navCurrent: 'podcast', episodes: [...episodes], team })
renderPage('index', 'index', { navCurrent: 'index', currentEpisode: episodes[0], participants })
renderPage('podcast', 'podcast', { navCurrent: 'podcast', episodes: [...episodes], participants })
renderPage('gesundes-geld', 'gesundes-geld', { meetups: site.meetups, upcomingMeetups: site.upcomingMeetups })
renderPage('meetups', 'meetups', { navCurrent: 'meetups', meetups: site.meetups, upcomingMeetups: site.upcomingMeetups })
renderPage('spenden', 'spenden', { navCurrent: 'spenden', spendenregister, spendenuebersicht })
@@ -57,11 +57,11 @@ renderPage('kontakt', 'kontakt', { navCurrent: 'kontakt' })
renderPage('datenschutz', 'datenschutz', { navCurrent: 'datenschutz' })
renderPage('adventskalender', 'adventskalender', { adventskalender })
episodes.forEach(episode => renderPage('episode', `podcast/${episode.slug}`, { navCurrent: 'podcast', episode, team }))
Object.keys(categories).forEach(category => renderPage('category', `podcast/${slugify(categories[category])}`, { navCurrent: 'podcast', category, categoryName: categories[category], episodes: episodes.filter(e => e.category === category), team }))
Object.keys(teamRaw).forEach(id => {
const member = teamRaw[id]
episodes.forEach(episode => renderPage('episode', `podcast/${episode.slug}`, { navCurrent: 'podcast', episode, participants }))
Object.keys(categories).forEach(category => renderPage('category', `podcast/${slugify(categories[category])}`, { navCurrent: 'podcast', category, categoryName: categories[category], episodes: episodes.filter(e => e.category === category), participants }))
Object.keys(participantsRaw).forEach(id => {
const member = participantsRaw[id]
const aliases = (member.aliases || []).map(m => m.toLowerCase()).concat(member.name.toLowerCase())
const eps = episodes.filter(e => e.participants.find(p => [id, ...aliases].includes(participantToId(p))))
renderPage('member', `team/${slugify(id)}`, { navCurrent: 'podcast', member, episodes: eps, team })
renderPage('member', `p/${slugify(id)}`, { navCurrent: 'podcast', member, episodes: eps, participants })
})