How I built this blog

May-26, 2024 · 3min

change language

Learn 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

Components

Images

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.

GitHub Alert

> [!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.

PWA

Add OG Image

Changelog

Upgrade tailwindcss v4

https://github.com/Debbl/aiwan.run/pull/19

Add OG Image

https://github.com/Debbl/aiwan.run/pull/14

Add GitHub Alert

https://github.com/Debbl/aiwan.run/commit/c9cb8268eb2037bec897ffbdeb780135d2145039

Add NProgress

https://github.com/Debbl/aiwan.run/pull/12

refactor use mdx

https://github.com/Debbl/aiwan.run/pull/11

  • Use mdx to refactor the blog nextjs documentation
  • Reference the implementation of nextra
  • Use app router as page to load mdx file
  • remark-mdx-layout global layout component
  • remark-static-image import static images from relative paths