mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig.space.git
synced 2025-12-13 16:26:50 +00:00
Trim feed size
Link to shownotes for older episodes
This commit is contained in:
@@ -130,14 +130,21 @@ const parseEpisode = e => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// episodes
|
// episodes
|
||||||
feed.rss.channel.item = feed.rss.channel.item.map(item => {
|
feed.rss.channel.item = feed.rss.channel.item.map((item, index) => {
|
||||||
const episode = parseEpisode(item)
|
const episode = parseEpisode(item)
|
||||||
episodes.push(episode)
|
episodes.push(episode)
|
||||||
|
|
||||||
|
const link = `https://einundzwanzig.space/podcast/${episode.slug}`
|
||||||
|
let description = episode.description
|
||||||
|
if (index > 20) {
|
||||||
|
description = `Shownotes: ${link}`
|
||||||
|
}
|
||||||
|
|
||||||
const updated = {
|
const updated = {
|
||||||
...item,
|
...item,
|
||||||
link: `https://einundzwanzig.space/podcast/${episode.slug}`, // replace Anchor link
|
link, // replace Anchor link
|
||||||
'itunes:summary': episode.description // please the validator, Anchor's itunes:summary contains HTML
|
description,
|
||||||
|
'itunes:summary': description // please the validator, Anchor's itunes:summary contains HTML
|
||||||
}
|
}
|
||||||
|
|
||||||
if (episode.number) {
|
if (episode.number) {
|
||||||
@@ -203,8 +210,6 @@ const parseEpisode = e => {
|
|||||||
return updated
|
return updated
|
||||||
})
|
})
|
||||||
|
|
||||||
writeJSON('feed', feed)
|
|
||||||
|
|
||||||
const outputXML = builder.build(feed)
|
const outputXML = builder.build(feed)
|
||||||
|
|
||||||
writeJSON('episodes', episodes)
|
writeJSON('episodes', episodes)
|
||||||
|
|||||||
Reference in New Issue
Block a user