Published on

Bilingual Post Demo

Authors

This is the English version

This post demonstrates the blog's bilingual feature. Click the 中文 button below the title to switch to the Chinese version.

How to write a bilingual post

  1. Put the Chinese (default) version at data/blog/post-name.mdx
  2. Put the English version at data/blog/en/post-name.mdx (same file name)
  3. When both files exist, the post page automatically shows the EN/中文 toggle

Code example

def greet(name: str) -> str:
    """Return a greeting."""
    return f"Hello, {name}!"

English versions are excluded from the homepage and post listings; they are only reachable through the toggle, so posts never show up twice.