2023-10-10 15:38:02 +00:00
|
|
|
import type { PageContext } from '../../renderer/types'
|
|
|
|
import { apiClient } from '../../utils/apiClient'
|
|
|
|
import type { PageProps } from '../types'
|
|
|
|
import { PRERENDERED_ARTICLES_COUNT } from '../../components/Views/Expo/Expo'
|
|
|
|
|
|
|
|
export const onBeforeRender = async (_pageContext: PageContext) => {
|
|
|
|
const expoShouts = await apiClient.getShouts({
|
|
|
|
filters: { excludeLayout: 'article' },
|
|
|
|
limit: PRERENDERED_ARTICLES_COUNT
|
|
|
|
})
|
2023-11-14 10:45:44 +00:00
|
|
|
const pageProps: PageProps = { expoShouts, seo: { title: '' } }
|
2023-10-10 15:38:02 +00:00
|
|
|
return {
|
|
|
|
pageContext: {
|
|
|
|
pageProps
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|