关于我

你好啊!

这是 about 页面用到的源代码。

---
import { getEntry } from "astro:content";
import Layout from "../layouts/Layout.astro";

const entry = await getEntry("about", "index");

if (!entry) {
  throw new Error("未找到 src/content/about/index.md 文件");
}
const { Content } = entry ? await entry.render() : { Content: null };
---

<Layout
  articleTitle={entry.data.title}
  articleDescription={entry.data.description}
>
  <h1>{entry.data.title}</h1>
  <div class="about-content">
    {Content && <Content />}
  </div>
</Layout>