Skip to content

Commit

Permalink
Update feed
Browse files Browse the repository at this point in the history
  • Loading branch information
dennisreimann committed Dec 15, 2023
1 parent 26a4a7f commit 98c2d81
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/episode.pug
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ extends /template.pug

block vars
- const title = episode.title
- const description = episode.description
- const description = episode.descriptionPlain
- const cardImage = episode.image
- const cardSize = episode.image.match('cloudfront') ? 3000 : 1400

Expand All @@ -25,4 +25,4 @@ block main
+episodePlayer(episode)

.content
!=episode.content
!=episode.description
13 changes: 7 additions & 6 deletions tasks/fetch_feed.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ const builder = new XMLBuilder(json2xmlOpts)
const parseEpisode = e => {
const guid = e.guid['#text']
const title = e.title.__cdata.trim()
const content = replacements(e.description.__cdata).trim()
const description = stripHTML(content)
const description = replacements(e.description.__cdata).trim()
const descriptionPlain = stripHTML(description)
let [, categoryName = 'News', number, titlePlain] = title.match(
/([\w\s]+?)?\s?#(\d+) - (.*)/
) || [, , , title]
Expand All @@ -53,7 +53,7 @@ const parseEpisode = e => {
if (categoryName === 'Buchclub') categoryName = 'Lesestunde'
if (categoryName === 'reCATion') categoryName = 'Verschiedenes'
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 block = blockMatch ? parseInt(blockMatch[1]) : null
const category = slugify(categoryName)
Expand Down Expand Up @@ -82,7 +82,7 @@ const parseEpisode = e => {
title,
titlePlain,
description,
content,
descriptionPlain,
duration,
slug,
image,
Expand Down Expand Up @@ -137,15 +137,16 @@ const parseEpisode = e => {
episodes.push(episode)

const link = `https://einundzwanzig.space/podcast/${episode.slug}`
let description = episode.description
let { description, descriptionPlain } = episode
if (index > 20) {
description = `Shownotes: ${link}`
descriptionPlain = `Shownotes: ${link}`
}

const updated = {
...item,
link, // replace Anchor link
description,
description: { __cdata: description },
'itunes:summary': description // please the validator, Anchor's itunes:summary contains HTML
}

Expand Down

0 comments on commit 98c2d81

Please sign in to comment.