Skip to content

Commit

Permalink
Fix title and URL creation
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisChinchilla committed Jul 10, 2024
1 parent 7ede250 commit 2192424
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/pages/podcast/whiskywordswit/[...slug].astro
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,24 @@ export async function getStaticPaths() {
removeNSPrefix: true,
};
const parser = new XMLParser(options);
const feedTest = await fetch('https://feeds.simplecast.com/whlwDbyc');
const feedTest = await fetch('https://anchor.fm/s/ef311c90/podcast/rss');
let rssFeedData = await feedTest.text();
let parsedFeed = await parser.parse(rssFeedData);
const allEpisodes = parsedFeed.rss.channel.item;
return await Promise.all(
allEpisodes.map(async (episode) => {
const additionalData = await getEntry('podcasts', slugify(episode.title[0]));
const additionalData = await getEntry('podcasts', slugify(episode.title));
// TODO: Is this the optimal way?
if (additionalData) {
let episodeData = additionalData.data;
return {
params: { slug: slugify(episode.title[0]) },
params: { slug: slugify(episode.title) },
props: { episode, episodeData },
};
} else {
return {
params: { slug: slugify(episode.title[0]) },
params: { slug: slugify(episode.title) },
props: { episode },
};
}
Expand Down

0 comments on commit 2192424

Please sign in to comment.