webapp/src/pages/authors.astro

16 lines
519 B
Plaintext
Raw Normal View History

2022-09-09 11:53:35 +00:00
---
import { AllAuthorsPage } from '../components/Views/AllAuthors'
import Zine from '../layouts/zine.astro'
import { apiClient } from '../utils/apiClient'
2022-09-14 15:44:06 +00:00
import { byCreated, sortBy } from '../utils/sortby'
2022-09-09 11:53:35 +00:00
2022-09-14 15:44:06 +00:00
const { by } = Object.fromEntries(Astro.url.searchParams.entries())
let authors = await apiClient.getAllAuthors()
authors = sortBy(authors, by || byCreated)
2022-09-09 11:53:35 +00:00
Astro.response.headers.set('Cache-Control', 's-maxage=1, stale-while-revalidate')
---
<Zine>
<AllAuthorsPage authors={authors} client:load />
</Zine>