Skip to content

Commit 0d2476e

Browse files
authored
[Hotfix] Fixes status.network blog rendering issues (#1064)
* fix: improve blog dynamic rendering and locale resolution * fix: remove height restriction on tag display in post cards
1 parent 28bbe54 commit 0d2476e

File tree

5 files changed

+16
-23
lines changed

5 files changed

+16
-23
lines changed

.changeset/calm-birds-rest.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'status.network': patch
3+
---
4+
5+
Fix blog dynamic rendering and locale resolution

apps/status.network/src/app/[locale]/blog/[slug]/page.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { getPostFAQItems } from '~app/_lib/faq'
2-
import { getPostBySlug, getPostsByTagSlug, getPostSlugs } from '~app/_lib/ghost'
2+
import { getPostBySlug, getPostsByTagSlug } from '~app/_lib/ghost'
33
import { Metadata } from '~app/_metadata'
44
import { formatDate } from '~app/_utils/format-date'
55
import { jsonLD, JSONLDScript } from '~app/_utils/json-ld'
@@ -9,17 +9,12 @@ import { notFound } from 'next/navigation'
99
import { PostAuthor } from '../../../_components/blog/post-author'
1010
import { PostCard } from '../../../_components/blog/post-card'
1111

12-
export const dynamicParams = true
12+
export const dynamic = 'force-dynamic'
1313

1414
type 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-
2318
export async function generateMetadata({ params }: Props) {
2419
const { slug } = await params
2520
const post = await getPostBySlug(slug)

apps/status.network/src/app/[locale]/blog/layout.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { Divider } from '~app/_components/divider'
22
import { Footer } from '~app/_components/footer'
33
import { BlogHeader } from '../../_components/blog/blog-header'
44

5+
export const dynamic = 'force-dynamic'
6+
57
type Props = {
68
children: React.ReactNode
79
}

apps/status.network/src/app/[locale]/layout.tsx

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
1-
import { getPathname } from '@status-im/status-network/utils'
1+
import { routing } from '~/i18n/routing'
22
import { NextIntlClientProvider } from 'next-intl'
33
import { 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+
2011
type Props = {
2112
children: React.ReactNode
2213
params: Promise<{ locale: string }>

apps/status.network/src/app/_components/blog/post-card.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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}

0 commit comments

Comments
 (0)