<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:version="2.0"><channel><title>我的个人博客</title><description>我的个人博客，主要分享技术文章、学习心得和生活感悟。</description><link>https://yourblog.com/</link><language>zh</language><item><title>从零搭建Astro博客的完整指南</title><link>https://yourblog.com/blog/astro-blog-guide/</link><guid isPermaLink="true">https://yourblog.com/blog/astro-blog-guide/</guid><description>一步步教你如何使用Astro框架搭建一个高性能的个人博客，包括主题配置、内容管理、部署上线等关键步骤。</description><content:encoded>&lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://yourblog.com/blog/astro-blog-guide/&quot;&gt;https://yourblog.com/blog/astro-blog-guide/&lt;/a&gt;&lt;/blockquote&gt; &lt;h2&gt;为什么选择Astro？&lt;/h2&gt;
&lt;p&gt;Astro是一个现代化的静态站点生成框架，它有着几个让人无法忽视的优势：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;零JavaScript默认&lt;/strong&gt;：Astro默认不会向客户端发送任何JavaScript，页面加载速度极快&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;内容优先&lt;/strong&gt;：内置Markdown/MDX支持，对博客场景天然友好&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;框架无关&lt;/strong&gt;：可以在同一个项目中混用React、Vue、Svelte等组件&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;岛屿架构&lt;/strong&gt;：只在需要交互的组件上加载JavaScript，其余保持纯HTML&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;搭建步骤&lt;/h2&gt;
&lt;h3&gt;1. 初始化项目&lt;/h3&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;npm create astro@latest my-blog
cd my-blog
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;选择&amp;quot;博客&amp;quot;模板可以快速获得一个开箱即用的博客项目。&lt;/p&gt;
&lt;h3&gt;2. 配置内容集合&lt;/h3&gt;
&lt;p&gt;Astro的内容集合（Content Collections）为博客文章提供了类型安全的schema验证：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-typescript&quot;&gt;import { defineCollection, z } from &amp;quot;astro:content&amp;quot;;

const blog = defineCollection({
  type: &amp;quot;content&amp;quot;,
  schema: z.object({
    title: z.string(),
    description: z.string(),
    pubDate: z.coerce.date(),
    categories: z.array(z.string()).optional(),
    tags: z.array(z.string()).optional(),
  }),
});

export const collections = { blog };
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;3. 编写文章&lt;/h3&gt;
&lt;p&gt;在 &lt;code&gt;src/content/blog/&lt;/code&gt; 目录下创建Markdown文件，在frontmatter中填写元数据：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-markdown&quot;&gt;---
title: 我的第一篇博客
description: 开始写作之旅
pubDate: 2026-05-01
categories: [&amp;quot;tech&amp;quot;]
tags: [&amp;quot;Astro&amp;quot;, &amp;quot;博客&amp;quot;]
---

文章正文...
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;4. 部署上线&lt;/h3&gt;
&lt;p&gt;Astro支持多种部署方式，最简单的是通过适配器部署到Vercel、Netlify等平台：&lt;/p&gt;
&lt;pre&gt;&lt;code class=&quot;language-bash&quot;&gt;npm run build
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;构建产物在 &lt;code&gt;dist/&lt;/code&gt; 目录，直接上传即可。&lt;/p&gt;
&lt;h2&gt;性能优化建议&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;图片优化&lt;/strong&gt;：使用Astro内置的 &lt;code&gt;&amp;lt;Image /&amp;gt;&lt;/code&gt; 组件自动处理图片格式和尺寸&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;字体优化&lt;/strong&gt;：使用 &lt;code&gt;font-face&lt;/code&gt; 配合 &lt;code&gt;font-display: swap&lt;/code&gt; 避免布局偏移&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;代码分割&lt;/strong&gt;：利用岛屿架构，只在交互组件上加载JS&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;预渲染&lt;/strong&gt;：确保所有博客页面都是静态预渲染的&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;总结&lt;/h2&gt;
&lt;p&gt;Astro是搭建博客的绝佳选择，它将性能、开发体验和内容管理做到了很好的平衡。如果你正在寻找一个快速、现代的博客框架，不妨试试Astro。&lt;/p&gt;
</content:encoded><dc:creator>我的博客</dc:creator><pubDate>Fri, 01 May 2026 00:00:00 GMT</pubDate></item><item><title>算法书</title><link>https://yourblog.com/blog/spring-reading-notes/</link><guid isPermaLink="true">https://yourblog.com/blog/spring-reading-notes/</guid><description>算法相关书籍推荐</description><content:encoded>&lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://yourblog.com/blog/spring-reading-notes/&quot;&gt;https://yourblog.com/blog/spring-reading-notes/&lt;/a&gt;&lt;/blockquote&gt; &lt;pre&gt;&lt;code&gt;##《hello算法》
&lt;/code&gt;&lt;/pre&gt;
</content:encoded><dc:creator>我的博客</dc:creator><pubDate>Tue, 28 Apr 2026 00:00:00 GMT</pubDate></item><item><title>First-blog</title><link>https://yourblog.com/blog/bbbllloooggg/</link><guid isPermaLink="true">https://yourblog.com/blog/bbbllloooggg/</guid><description>meiyou</description><content:encoded>&lt;blockquote&gt;This rendering was automatically generated by Frosti Feed and may have formatting issues. For the best experience, please visit: &lt;a href=&quot;https://yourblog.com/blog/bbbllloooggg/&quot;&gt;https://yourblog.com/blog/bbbllloooggg/&lt;/a&gt;&lt;/blockquote&gt; &lt;p&gt;这是我的第一篇博客123~~~&lt;/p&gt;
</content:encoded><dc:creator>我的博客</dc:creator><pubDate>Wed, 22 Apr 2026 00:00:00 GMT</pubDate></item></channel></rss>