2020-12-06 21:49:37 +11:00
|
|
|
import "../../components/main.js"
|
|
|
|
|
import Layout from "../../components/main.js"
|
2021-02-04 14:27:14 +11:00
|
|
|
import Link from 'next/link'
|
|
|
|
|
import getConfig from 'next/config'
|
2020-12-06 21:49:37 +11:00
|
|
|
|
2021-02-04 14:27:14 +11:00
|
|
|
export async function getServerSideProps(context) {
|
|
|
|
|
const { serverRuntimeConfig, publicRuntimeConfig } = getConfig()
|
|
|
|
|
const secres = await fetch(serverRuntimeConfig.base_path + `/api/sections`)
|
2020-12-06 21:49:37 +11:00
|
|
|
const secdata = await secres.json()
|
|
|
|
|
|
2021-02-04 14:27:14 +11:00
|
|
|
const podcastres = await fetch(serverRuntimeConfig.base_path + `/api/podcasts/bystatus/0`)
|
2020-12-06 21:49:37 +11:00
|
|
|
const podcastdata = await podcastres.json()
|
|
|
|
|
|
2021-02-04 14:27:14 +11:00
|
|
|
const pagedata = {'title': 'Angry Beanie - Archived Podcast Projects'}
|
|
|
|
|
|
2020-12-06 21:49:37 +11:00
|
|
|
return {
|
2021-02-04 14:27:14 +11:00
|
|
|
props: { sections : secdata, podcastdata, pagedata }, // will be passed to the page component as props
|
2020-12-06 21:49:37 +11:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-02-04 14:27:14 +11:00
|
|
|
const PodcastArchived = ({sections, podcastdata, pagedata}) => (
|
|
|
|
|
<Layout sections={sections} pagedata={pagedata}>
|
2020-12-06 21:49:37 +11:00
|
|
|
<h1>Archived Podcasts</h1>
|
|
|
|
|
{podcastdata.shows.map((podcast) => (
|
2021-02-04 14:27:14 +11:00
|
|
|
<h1><Link href={"/podcasts/shows/" + podcast.slug}>{podcast.title}</Link></h1>
|
2020-12-06 21:49:37 +11:00
|
|
|
))}
|
|
|
|
|
|
|
|
|
|
</Layout>
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
export default PodcastArchived
|