21 lines
738 B
Plaintext
21 lines
738 B
Plaintext
---
|
|
import { Root } from '../../../components/Root'
|
|
import Prerendered from '../../../main.astro'
|
|
import { apiClient } from '../../../utils/apiClient'
|
|
import { initRouter } from '../../../stores/router'
|
|
import { PRERENDERED_ARTICLES_COUNT } from '../../../components/Views/Author'
|
|
|
|
const slug = Astro.params.slug.toString()
|
|
const shouts = await apiClient.loadShoutsBy({ by: { authors: [slug] } , amount: PRERENDERED_ARTICLES_COUNT })
|
|
const author = await apiClient.loadAuthorsBy({ by: { slug } })
|
|
|
|
const { pathname, search } = Astro.url
|
|
initRouter(pathname, search)
|
|
|
|
Astro.response.headers.set('Cache-Control', 's-maxage=1, stale-while-revalidate')
|
|
---
|
|
|
|
<Prerendered>
|
|
<Root shouts={shouts} author={author} client:load />
|
|
</Prerendered>
|