May-26, 2024 · 3min
change languageLearn how to build a static blog using Next.js and MDX, including component development, PWA configuration, and Open Graph image generation.
Note
This article is outdated, please refer to Refactor This Blog With FumaDocs
Can directly import images in the relative path, use the
remark-static-image
plugin, automatically import images, see Using MDX Static Images in Next.js for details.
> [!NOTE]
> Highlights information that users should take into account, even when skimming.
> [!TIP]
> Optional information to help a user be more successful.
> [!IMPORTANT]
> Crucial information necessary for users to succeed.
> [!WARNING]
> Critical content demanding immediate user attention due to potential risks.
> [!CAUTION]
> Negative potential consequences of an action.
Note
Highlights information that users should take into account, even when skimming.
Tip
Optional information to help a user be more successful.
Important
Crucial information necessary for users to succeed.
Warning
Critical content demanding immediate user attention due to potential risks.
Caution
Negative potential consequences of an action.
[og/[slug]/route.tsx]
to change the slug to [post.pageName].png
generateStaticParams
to generate OG images for postsremark-mdx-slug
to get the slug
remark-mdx-formatter
to configure openGraph
to use [/og/${post.pageName}.png]
as the OG imagehttps://github.com/Debbl/aiwan.run/commit/c9cb8268eb2037bec897ffbdeb780135d2145039