File tree Expand file tree Collapse file tree 5 files changed +16
-23
lines changed
apps/status.network/src/app Expand file tree Collapse file tree 5 files changed +16
-23
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' status.network ' : patch
3+ ---
4+
5+ Fix blog dynamic rendering and locale resolution
Original file line number Diff line number Diff line change 11import { getPostFAQItems } from '~app/_lib/faq'
2- import { getPostBySlug , getPostsByTagSlug , getPostSlugs } from '~app/_lib/ghost'
2+ import { getPostBySlug , getPostsByTagSlug } from '~app/_lib/ghost'
33import { Metadata } from '~app/_metadata'
44import { formatDate } from '~app/_utils/format-date'
55import { jsonLD , JSONLDScript } from '~app/_utils/json-ld'
@@ -9,17 +9,12 @@ import { notFound } from 'next/navigation'
99import { PostAuthor } from '../../../_components/blog/post-author'
1010import { PostCard } from '../../../_components/blog/post-card'
1111
12- export const dynamicParams = true
12+ export const dynamic = 'force-dynamic'
1313
1414type Props = {
1515 params : Promise < { slug : string } >
1616}
1717
18- export async function generateStaticParams ( ) {
19- const slugs = await getPostSlugs ( )
20- return slugs . map ( slug => ( { slug } ) )
21- }
22-
2318export async function generateMetadata ( { params } : Props ) {
2419 const { slug } = await params
2520 const post = await getPostBySlug ( slug )
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import { Divider } from '~app/_components/divider'
22import { Footer } from '~app/_components/footer'
33import { BlogHeader } from '../../_components/blog/blog-header'
44
5+ export const dynamic = 'force-dynamic'
6+
57type Props = {
68 children : React . ReactNode
79}
Original file line number Diff line number Diff line change 1- import { getPathname } from '@status-im/status-network/utils '
1+ import { routing } from '~/i18n/routing '
22import { NextIntlClientProvider } from 'next-intl'
33import { getMessages } from 'next-intl/server'
4- import { Metadata } from '../_metadata'
54
6- export async function generateMetadata ( {
7- params,
8- } : {
9- params : Promise < { locale : string } >
10- } ) {
11- const { locale } = await params
12- const pathname = await getPathname ( )
13-
14- return Metadata ( {
15- pathname,
16- locale,
17- } )
5+ export function generateStaticParams ( ) {
6+ return routing . locales . map ( locale => ( { locale } ) )
187}
198
9+ export const dynamicParams = false
10+
2011type Props = {
2112 children : React . ReactNode
2213 params : Promise < { locale : string } >
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ export async function PostCard({
2727 >
2828 < div className = "flex grow flex-col gap-2 p-4" >
2929 { showTag && (
30- < div className = "h-6 overflow-hidden" >
30+ < div >
3131 { tag && (
3232 < span className = "inline-flex rounded-20 border border-neutral-20 px-2 py-[3px] text-13 font-500" >
3333 { tag . name }
@@ -93,7 +93,7 @@ export async function HighlightedPostCard({ post }: HighlightedPostCardProps) {
9393 </ div >
9494
9595 < div className = "flex flex-col gap-2 xl:py-5 xl:pr-5" >
96- < div className = "h-6 overflow-hidden" >
96+ < div >
9797 { tag && (
9898 < span className = "inline-flex rounded-20 border border-neutral-20 px-2 py-[3px] text-13 font-500" >
9999 { tag . name }
You can’t perform that action at this time.
0 commit comments