mirror of
https://github.com/Einundzwanzig-Podcast/einundzwanzig.space.git
synced 2025-12-13 16:26:50 +00:00
Update feed
This commit is contained in:
@@ -2,7 +2,7 @@ extends /template.pug
|
|||||||
|
|
||||||
block vars
|
block vars
|
||||||
- const title = episode.title
|
- const title = episode.title
|
||||||
- const description = episode.description
|
- const description = episode.descriptionPlain
|
||||||
- const cardImage = episode.image
|
- const cardImage = episode.image
|
||||||
- const cardSize = episode.image.match('cloudfront') ? 3000 : 1400
|
- const cardSize = episode.image.match('cloudfront') ? 3000 : 1400
|
||||||
|
|
||||||
@@ -25,4 +25,4 @@ block main
|
|||||||
+episodePlayer(episode)
|
+episodePlayer(episode)
|
||||||
|
|
||||||
.content
|
.content
|
||||||
!=episode.content
|
!=episode.description
|
||||||
|
|||||||
@@ -42,8 +42,8 @@ const builder = new XMLBuilder(json2xmlOpts)
|
|||||||
const parseEpisode = e => {
|
const parseEpisode = e => {
|
||||||
const guid = e.guid['#text']
|
const guid = e.guid['#text']
|
||||||
const title = e.title.__cdata.trim()
|
const title = e.title.__cdata.trim()
|
||||||
const content = replacements(e.description.__cdata).trim()
|
const description = replacements(e.description.__cdata).trim()
|
||||||
const description = stripHTML(content)
|
const descriptionPlain = stripHTML(description)
|
||||||
let [, categoryName = 'News', number, titlePlain] = title.match(
|
let [, categoryName = 'News', number, titlePlain] = title.match(
|
||||||
/([\w\s]+?)?\s?#(\d+) - (.*)/
|
/([\w\s]+?)?\s?#(\d+) - (.*)/
|
||||||
) || [, , , title]
|
) || [, , , title]
|
||||||
@@ -53,7 +53,7 @@ const parseEpisode = e => {
|
|||||||
if (categoryName === 'Buchclub') categoryName = 'Lesestunde'
|
if (categoryName === 'Buchclub') categoryName = 'Lesestunde'
|
||||||
if (categoryName === 'reCATion') categoryName = 'Verschiedenes'
|
if (categoryName === 'reCATion') categoryName = 'Verschiedenes'
|
||||||
if (categoryName === 'NostrTalk') categoryName = 'NostrTalk'
|
if (categoryName === 'NostrTalk') categoryName = 'NostrTalk'
|
||||||
const firstLine = description.split('\n')[0]
|
const firstLine = descriptionPlain.split('\n')[0]
|
||||||
const blockMatch = firstLine.match(/Blockzeit\s(\d+)/)
|
const blockMatch = firstLine.match(/Blockzeit\s(\d+)/)
|
||||||
const block = blockMatch ? parseInt(blockMatch[1]) : null
|
const block = blockMatch ? parseInt(blockMatch[1]) : null
|
||||||
const category = slugify(categoryName)
|
const category = slugify(categoryName)
|
||||||
@@ -82,7 +82,7 @@ const parseEpisode = e => {
|
|||||||
title,
|
title,
|
||||||
titlePlain,
|
titlePlain,
|
||||||
description,
|
description,
|
||||||
content,
|
descriptionPlain,
|
||||||
duration,
|
duration,
|
||||||
slug,
|
slug,
|
||||||
image,
|
image,
|
||||||
@@ -137,15 +137,16 @@ const parseEpisode = e => {
|
|||||||
episodes.push(episode)
|
episodes.push(episode)
|
||||||
|
|
||||||
const link = `https://einundzwanzig.space/podcast/${episode.slug}`
|
const link = `https://einundzwanzig.space/podcast/${episode.slug}`
|
||||||
let description = episode.description
|
let { description, descriptionPlain } = episode
|
||||||
if (index > 20) {
|
if (index > 20) {
|
||||||
description = `Shownotes: ${link}`
|
description = `Shownotes: ${link}`
|
||||||
|
descriptionPlain = `Shownotes: ${link}`
|
||||||
}
|
}
|
||||||
|
|
||||||
const updated = {
|
const updated = {
|
||||||
...item,
|
...item,
|
||||||
link, // replace Anchor link
|
link, // replace Anchor link
|
||||||
description,
|
description: { __cdata: description },
|
||||||
'itunes:summary': description // please the validator, Anchor's itunes:summary contains HTML
|
'itunes:summary': description // please the validator, Anchor's itunes:summary contains HTML
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user