fix: set dynamic to force-static in blog post page
This commit is contained in:
parent
f589fa2d00
commit
1bc4cf023c
@ -1,3 +1,5 @@
|
|||||||
|
export const dynamic = 'force-static';
|
||||||
|
|
||||||
import AllPostsButton from '@/components/blog/all-posts-button';
|
import AllPostsButton from '@/components/blog/all-posts-button';
|
||||||
import BlogGrid from '@/components/blog/blog-grid';
|
import BlogGrid from '@/components/blog/blog-grid';
|
||||||
import { BlogToc } from '@/components/blog/blog-toc';
|
import { BlogToc } from '@/components/blog/blog-toc';
|
||||||
@ -115,6 +117,8 @@ export default async function BlogPostPage(props: BlogPostPageProps) {
|
|||||||
const publishDate = post.date;
|
const publishDate = post.date;
|
||||||
const date = formatDate(new Date(publishDate));
|
const date = formatDate(new Date(publishDate));
|
||||||
const toc = await getTableOfContents(post.content);
|
const toc = await getTableOfContents(post.content);
|
||||||
|
|
||||||
|
// getTranslations may cause error DYNAMIC_SERVER_USAGE, so we set dynamic to force-static
|
||||||
const t = await getTranslations('BlogPage');
|
const t = await getTranslations('BlogPage');
|
||||||
|
|
||||||
// get related posts
|
// get related posts
|
||||||
|
Loading…
Reference in New Issue
Block a user