I have to create a podcast website for someone, they have like 100+ episodes.
How can I create a separate page for each episode? I don't want to make 100s of pages manually.
Is there any ez way?
11 Replies
Something like Astro would be perfect for this.
* A static site generator that uses a template to generate each would work. Each time a new episode is made the SSG makes a new page
* Make one
/episode
page that's an episode template and use a query param to decide what page info to fetch and display (/episode?no=38
)
* A server-side render backend could do the same as an SSG, but it makes the server do work on each HTTP call, and since podcast episodes aren't very dynamic it's kind of a wasteThanks 👍
Can astro do that?
I believe Astro can, yes
How can it be implemented in astro? I have not used astro as much, so I am unaware of the process of creating something that acts as a component and fetched data from external sources and sets them dynamically over many pages with astro.
https://docs.astro.build/en/core-concepts/routing/#dynamic-routes
you would do it the same as any other "blog" style component layout
url params/query strings are teh way browsers have worked for A LONG time and frameworks* like Astro/SvelteKit leverage them really well.. Dynamic routes are great for this.
Personally I like how SvelteKit exposes/uses them better but both work really similar.
IM halfway making a project im making a podcast website for someone- i cant figure out the templating and dynamic routing
I have an index page listing some episodes and when clicked on it i want to open the template with episode-specific info
episodeList.astro
[slug].astro
showing error 404 when clicked on an episode
what folder is the
[slug].astro
inside of?
Can you manually get to the individual episode pages by manually entering in the url for an episode?
No I can't get to it
can you
console.log(episodes)
in the frontmatter and see what it returns? (it'll be in your terminal, not the browser console)
This code is working somehow. Thanks for the help tho
this is the slug