webapp/src/pages/author/[slug]/index.astro

18 lines
564 B
Plaintext
Raw Normal View History

2022-09-09 11:53:35 +00:00
---
import { AuthorPage } from '../../../components/Views/Author'
import Zine from '../../../layouts/zine.astro'
import { apiClient } from '../../../utils/apiClient'
2022-09-14 15:44:06 +00:00
const limit = 50
const offset = 0
2022-09-09 11:53:35 +00:00
const slug = Astro.params.slug.toString()
2022-09-14 11:27:10 +00:00
const articles = await apiClient.getArticlesForAuthors({ authorSlugs: [slug], offset, limit })
2022-09-09 11:53:35 +00:00
const author = articles[0].authors.find((a) => a.slug === slug)
Astro.response.headers.set('Cache-Control', 's-maxage=1, stale-while-revalidate')
---
<Zine>
<AuthorPage authorArticles={articles} author={author} />
</Zine>