diff --git a/src/content/posts/en/post-1.md b/src/content/posts/en/post-1.md index beb1473..df87cb8 100644 --- a/src/content/posts/en/post-1.md +++ b/src/content/posts/en/post-1.md @@ -10,10 +10,6 @@ image: tags: ["astro", "blogging", "learning-in-public"] --- -# My First Blog Post - -Published on: 2020-07-01 - Welcome to my _new blog_ about learning Astro! Here, I will share my learning journey as I build a new website. ## What I've accomplished diff --git a/src/content/posts/zh/post-1.md b/src/content/posts/zh/post-1.mdx similarity index 96% rename from src/content/posts/zh/post-1.md rename to src/content/posts/zh/post-1.mdx index 6d64665..29948cb 100644 --- a/src/content/posts/zh/post-1.md +++ b/src/content/posts/zh/post-1.mdx @@ -10,6 +10,10 @@ image: tags: ["astro", "博客", "公开学习"] --- +export const title = "mdx" + +## {title} + 欢迎来到我学习关于 Astro 的新博客!在这里,我将分享我建立新网站的学习历程。 ## 我做了什么 diff --git a/src/pages/[lang]/posts/[...slug].astro b/src/pages/[lang]/posts/[...slug].astro index 1d2bc24..1db4e7d 100644 --- a/src/pages/[lang]/posts/[...slug].astro +++ b/src/pages/[lang]/posts/[...slug].astro @@ -1,4 +1,5 @@ --- +import { render } from "astro:content" import { langs } from "~/i18n/ui" import { getLangFromUrl } from "~/i18n/utils" import MainLayout from "~/layouts/main.astro" @@ -24,6 +25,8 @@ export async function getStaticPaths() { const lang = getLangFromUrl(Astro.url) const { post } = Astro.props + +const { Content } = await render(post) --- @@ -35,7 +38,9 @@ const { post } = Astro.props -
+
+ +
{