<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>itshumei&apos;s blog</title><description>Astro × Cloudflare Workers</description><link>https://www.itshumei.cn/</link><language>zh_CN</language><item><title>你好，世界</title><link>https://www.itshumei.cn/posts/hello-world/</link><guid isPermaLink="true">https://www.itshumei.cn/posts/hello-world/</guid><description>itshumei&apos;s blog 的第一篇文章，介绍这个博客的技术栈和部署方式。</description><pubDate>Tue, 13 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;欢迎来到 &lt;strong&gt;itshumei&apos;s blog&lt;/strong&gt;！这是第一篇文章。&lt;/p&gt;
&lt;h2&gt;这个博客是怎么搭的&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Astro + Fuwari 主题&lt;/strong&gt;：页面在构建时预渲染成纯静态 HTML，速度极快。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cloudflare Workers + Static Assets&lt;/strong&gt;：静态文件直接从 Cloudflare 边缘节点分发；只有 &lt;code&gt;/api/*&lt;/code&gt; 路由跑在 Worker 里。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;GitHub OAuth&lt;/strong&gt;：访客点「使用 GitHub 登录」，走标准授权码流程；登录后拿到一个 HMAC-SHA256 签名的 HttpOnly cookie 会话（7 天有效），服务端无状态，不需要 KV。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Cloudflare D1&lt;/strong&gt;：评论和留言存在 Serverless SQLite 里，带简单限流。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;明暗模式&lt;/strong&gt;：右上角太阳/月亮按钮切换亮色、暗色、跟随系统三种模式，还支持自选主题色。&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;写新文章&lt;/h2&gt;
&lt;p&gt;往 &lt;code&gt;src/content/posts/&lt;/code&gt; 里扔一个 &lt;code&gt;.md&lt;/code&gt; 文件，frontmatter 写这几项即可：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;---
title: 文章标题
published: 2026-10-13
description: 一句话简介
tags: [标签1, 标签2]
category: 分类名
---
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;然后 &lt;code&gt;pnpm run deploy&lt;/code&gt;，完事。&lt;/p&gt;
&lt;p&gt;:::tip[提示]
这篇文章下面的评论区就是活的——登录 GitHub 后试试发一条。站长的留言板在导航栏「留言板」。
:::&lt;/p&gt;
&lt;h2&gt;数学公式也支持&lt;/h2&gt;
&lt;p&gt;行内公式 $e^{i\pi} + 1 = 0$，块级公式：&lt;/p&gt;
&lt;p&gt;$$
\int_{-\infty}^{\infty} e^{-x^2} , dx = \sqrt{\pi}
$$&lt;/p&gt;
&lt;h2&gt;代码高亮&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;// Cloudflare Worker 里的地理信息就一行
const city = request.cf?.city; // &quot;Shenyang&quot;
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>为什么选择 Workers 而不是 Pages</title><link>https://www.itshumei.cn/posts/why-workers/</link><guid isPermaLink="true">https://www.itshumei.cn/posts/why-workers/</guid><description>Cloudflare 官方已推荐新项目直接用 Workers + Static Assets，本文简述原因。</description><pubDate>Mon, 12 Oct 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Cloudflare 官方文档现在明确写着：&lt;strong&gt;新网站和新应用一律推荐 Workers + Static Assets&lt;/strong&gt;，Pages 只建议存量项目继续维护。&lt;/p&gt;
&lt;h2&gt;差异在哪&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;能力更全&lt;/strong&gt;：Worker 能访问全部 Cloudflare 平台能力（D1、KV、R2、Queues、AI……），静态资产只是它的一个 binding。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;路由更灵活&lt;/strong&gt;：assets binding 让你精确控制哪些路径跑 Worker、哪些直接走静态文件。本博客就是页面全静态、只有 &lt;code&gt;/api/*&lt;/code&gt; 进 Worker，省钱又快。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;一条部署链路&lt;/strong&gt;：&lt;code&gt;wrangler deploy&lt;/code&gt; 同时更新代码和资产，版本、回滚、渐进发布都在同一套体系里。&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;对 Astro 意味着什么&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;@astrojs/cloudflare&lt;/code&gt; 的构建产物就是 &lt;code&gt;dist/_worker.js&lt;/code&gt; + 静态文件，&lt;code&gt;wrangler.jsonc&lt;/code&gt; 里 &lt;code&gt;main&lt;/code&gt; 指向前者、&lt;code&gt;assets.directory&lt;/code&gt; 指向 &lt;code&gt;./dist&lt;/code&gt;，天然就是 Workers 形态。&lt;/p&gt;
&lt;p&gt;所以这个博客从一开始就按 Workers 部署，没有历史包袱。&lt;/p&gt;
&lt;p&gt;:::note[相关阅读]
Cloudflare 的 Pages → Workers 迁移指南：developers.cloudflare.com/workers/static-assets/migration-guides/migrate-from-pages/
:::&lt;/p&gt;
</content:encoded></item><item><title>Markdown Extended Features</title><link>https://www.itshumei.cn/posts/markdown-extended/</link><guid isPermaLink="true">https://www.itshumei.cn/posts/markdown-extended/</guid><description>Read more about Markdown features in Fuwari</description><pubDate>Wed, 01 May 2024 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;GitHub Repository Cards&lt;/h2&gt;
&lt;p&gt;You can add dynamic cards that link to GitHub repositories, on page load, the repository information is pulled from the GitHub API.&lt;/p&gt;
&lt;p&gt;::github{repo=&quot;Fabrizz/MMM-OnSpotify&quot;}&lt;/p&gt;
&lt;p&gt;Create a GitHub repository card with the code &lt;code&gt;::github{repo=&quot;&amp;lt;owner&amp;gt;/&amp;lt;repo&amp;gt;&quot;}&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;::github{repo=&quot;saicaca/fuwari&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Admonitions&lt;/h2&gt;
&lt;p&gt;Following types of admonitions are supported: &lt;code&gt;note&lt;/code&gt; &lt;code&gt;tip&lt;/code&gt; &lt;code&gt;important&lt;/code&gt; &lt;code&gt;warning&lt;/code&gt; &lt;code&gt;caution&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;:::note
Highlights information that users should take into account, even when skimming.
:::&lt;/p&gt;
&lt;p&gt;:::tip
Optional information to help a user be more successful.
:::&lt;/p&gt;
&lt;p&gt;:::important
Crucial information necessary for users to succeed.
:::&lt;/p&gt;
&lt;p&gt;:::warning
Critical content demanding immediate user attention due to potential risks.
:::&lt;/p&gt;
&lt;p&gt;:::caution
Negative potential consequences of an action.
:::&lt;/p&gt;
&lt;h3&gt;Basic Syntax&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;:::note
Highlights information that users should take into account, even when skimming.
:::

:::tip
Optional information to help a user be more successful.
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Custom Titles&lt;/h3&gt;
&lt;p&gt;The title of the admonition can be customized.&lt;/p&gt;
&lt;p&gt;:::note[MY CUSTOM TITLE]
This is a note with a custom title.
:::&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::note[MY CUSTOM TITLE]
This is a note with a custom title.
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;GitHub Syntax&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;[!TIP]
&lt;a href=&quot;https://github.com/orgs/community/discussions/16925&quot;&gt;The GitHub syntax&lt;/a&gt; is also supported.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code&gt;&amp;gt; [!NOTE]
&amp;gt; The GitHub syntax is also supported.

&amp;gt; [!TIP]
&amp;gt; The GitHub syntax is also supported.
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;Spoiler&lt;/h3&gt;
&lt;p&gt;You can add spoilers to your text. The text also supports &lt;strong&gt;Markdown&lt;/strong&gt; syntax.&lt;/p&gt;
&lt;p&gt;The content :spoiler[is hidden &lt;strong&gt;ayyy&lt;/strong&gt;]!&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;The content :spoiler[is hidden **ayyy**]!

&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item></channel></rss>