我的第一篇博客文章

7/1/2022

这是我 Astro 博客的第一篇文章。

作者:Astro 学习者

The Astro logo on a dark background with a pink glow.

astro

blogging

learning in public

欢迎来到我学习关于 Astro 的新博客!在这里,我将分享我建立新网站的学习历程。

我做了什么

  1. 安装 Astro:首先,我创建了一个新的 Astro 项目并设置好了我的在线账号。

  2. 制作页面:然后我学习了如何通过创建新的 .astro 文件并将它们保存在 src/pages/ 文件夹里来制作页面。

  3. 发表博客文章:这是我的第一篇博客文章!我现在有用 Astro 编写的页面和用 Markdown 写的文章了!

下一步计划

我将完成 Astro 教程,然后继续编写更多内容。关注我以获取更多信息。

miku

import rss from '@astrojs/rss';
import { getCollection } from 'astro:content';

export async function GET(context) {
 const posts = await getCollection("blog");
 return rss({
   title: 'Astro Learner | Blog',
   description: 'My journey learning Astro',
   site: context.site,
   items: posts.map((post) => ({
     title: post.data.title,
     pubDate: post.data.pubDate,
     description: post.data.description,
     link: `/posts/${post.id}/`,
   })),
   customData: `<language>zh-CN</language>`,
 });
}