11import groq from 'groq' ;
2- import { unstable_noStore as noStore } from 'next/cache' ;
32import { getTranslations } from 'next-intl/server' ;
43
54import { client } from '@/client' ;
65import BlogFilters from '@/components/blog/BlogFilters' ;
76import { BlogPageHeader } from '@/components/blog/BlogPageHeader' ;
87import { DynamicGridBackground } from '@/components/shared/DynamicGridBackground' ;
98
10- export const revalidate = 0 ;
9+ export const revalidate = 3600 ;
1110
1211export async function generateMetadata ( {
1312 params,
@@ -25,19 +24,13 @@ export async function generateMetadata({
2524
2625export default async function BlogPage ( {
2726 params,
28- searchParams,
2927} : {
3028 params : Promise < { locale : string } > ;
31- searchParams ?: Promise < { [ key : string ] : string | string [ ] | undefined } > ;
3229} ) {
33- noStore ( ) ;
3430 const { locale } = await params ;
3531 const t = await getTranslations ( { locale, namespace : 'blog' } ) ;
36- const sp = searchParams ? await searchParams : undefined ;
37- const authorParam = typeof sp ?. author === 'string' ? sp . author . trim ( ) : '' ;
38- const hasAuthorFilter = authorParam . length > 0 ;
3932
40- const posts = await client . withConfig ( { useCdn : false } ) . fetch (
33+ const posts = await client . fetch (
4134 groq `
4235 *[_type == "post" && defined(slug.current)]
4336 | order(coalesce(publishedAt, _createdAt) desc) {
@@ -74,7 +67,7 @@ export default async function BlogPage({
7467 ` ,
7568 { locale }
7669 ) ;
77- const categories = await client . withConfig ( { useCdn : false } ) . fetch (
70+ const categories = await client . fetch (
7871 groq `
7972 *[_type == "category"] | order(orderRank asc) {
8073 _id,
@@ -87,9 +80,7 @@ export default async function BlogPage({
8780 return (
8881 < DynamicGridBackground className = "bg-gray-50 py-10 transition-colors duration-300 dark:bg-transparent" >
8982 < main className = "relative z-10 mx-auto max-w-7xl px-4 pt-6 pb-12 sm:px-6 lg:px-8" >
90- { ! hasAuthorFilter && (
91- < BlogPageHeader title = { t ( 'title' ) } subtitle = { t ( 'subtitle' ) } />
92- ) }
83+ < BlogPageHeader title = { t ( 'title' ) } subtitle = { t ( 'subtitle' ) } />
9384 < BlogFilters
9485 posts = { posts }
9586 categories = { categories }
0 commit comments