<?xml version="1.0" encoding="UTF-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>xiaobuhui的博客</title><description>A Material 3 anime blog</description><link>https://xiaobuhui.xyz/</link><language>zh_CN</language><item><title>使用指南</title><link>https://xiaobuhui.xyz/posts/guide/</link><guid isPermaLink="true">https://xiaobuhui.xyz/posts/guide/</guid><description>从写文章、frontmatter 字段到扩展语法、加密与媒体的完整说明。</description><pubDate>Wed, 26 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;欢迎使用 &lt;strong&gt;Shirone&lt;/strong&gt;（白音）——一个围绕 &lt;strong&gt;Astro 7&lt;/strong&gt;、&lt;strong&gt;Svelte 5&lt;/strong&gt; 与 &lt;strong&gt;Material 3 Expressive（M3E）&lt;/strong&gt; 设计系统打造的、富有表现力、动漫风格的个人博客主题。&lt;/p&gt;
&lt;p&gt;本指南将带你了解文章创建、frontmatter 字段、目录结构，以及全套内置的 Markdown 与 MDX 扩展语法。&lt;/p&gt;
&lt;p&gt;:::tip
Shirone 优先采用服务端渲染（SSR-first）。在站内导航时，Swup 会无缝替换主容器，同时保留外层应用外壳与持续的背景音乐播放。
:::&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;1. 创建新文章&lt;/h2&gt;
&lt;p&gt;你可以使用内置 CLI 命令快速生成带标准 frontmatter 的新文章：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Create a single-file post
pnpm new-post my-first-post

# Or create a post in a sub-directory
pnpm new-post guides/getting-started
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;新创建的文件会被放在 &lt;code&gt;src/content/posts/&lt;/code&gt;。&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;2. Frontmatter 规范&lt;/h2&gt;
&lt;p&gt;每篇 Markdown（&lt;code&gt;.md&lt;/code&gt;）或 MDX（&lt;code&gt;.mdx&lt;/code&gt;）文章都以一段 YAML frontmatter 开头，用于定义其元数据。&lt;/p&gt;
&lt;h3&gt;示例&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;---
title: &quot;Exploring Material 3 Expressive Design&quot;
published: 2026-08-26
updated: 2026-08-27
publishedAt: 2026-08-26T10:00:00+08:00
updatedAt: 2026-08-27T09:30:00+08:00
pinned: true
description: &quot;A deep dive into dynamic HCT color science and fluid transitions in Shirone.&quot;
image: &quot;./cover.webp&quot;
tags: [M3E, Design, Frontend]
category: Guides
draft: false
comment: true
---
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;支持的 Frontmatter 字段&lt;/h3&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Field&lt;/th&gt;
&lt;th&gt;Type&lt;/th&gt;
&lt;th&gt;Required&lt;/th&gt;
&lt;th&gt;Description&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;title&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;string&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;是&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;文章的主标题。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;published&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Date&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;strong&gt;是&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;发布日期，格式为 &lt;code&gt;YYYY-MM-DD&lt;/code&gt;。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;publishedAt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Date&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;否&lt;/td&gt;
&lt;td&gt;用于排序同一天发布文章的精确发布时刻。它必须落在站点配置时区中 &lt;code&gt;published&lt;/code&gt; 当天。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;updated&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Date&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;否&lt;/td&gt;
&lt;td&gt;最后更新日期。填写后，会显示更新提示徽章。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;updatedAt&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;Date&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;否&lt;/td&gt;
&lt;td&gt;供订阅源与机器可读元数据使用的精确更新时刻。必须与 &lt;code&gt;updated&lt;/code&gt; 配对使用。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;pinned&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;boolean&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;否&lt;/td&gt;
&lt;td&gt;将文章固定在文章列表顶部（默认：&lt;code&gt;false&lt;/code&gt;）。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;description&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;string&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;否&lt;/td&gt;
&lt;td&gt;文章摘要，显示在文章卡片、搜索结果与 OpenGraph 元数据中。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;image&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;string&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;否&lt;/td&gt;
&lt;td&gt;封面图路径。支持相对路径（&lt;code&gt;./cover.webp&lt;/code&gt;）、公共路径（&lt;code&gt;/images/cover.jpg&lt;/code&gt;）或远程 URL。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;tags&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;string[]&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;否&lt;/td&gt;
&lt;td&gt;用于分类筛选与标签云的标签名数组。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;category&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;string&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;否&lt;/td&gt;
&lt;td&gt;用于分类索引的主分类名称。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;draft&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;boolean&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;否&lt;/td&gt;
&lt;td&gt;标记为草稿。草稿文章在生产环境构建（&lt;code&gt;pnpm build&lt;/code&gt;）时会被隐藏。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;comment&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;boolean&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;否&lt;/td&gt;
&lt;td&gt;开关当前文章的评论区（默认：&lt;code&gt;true&lt;/code&gt;）。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;lang&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;string&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;否&lt;/td&gt;
&lt;td&gt;与站点默认语言不同时的语言代码（如 &lt;code&gt;en&lt;/code&gt;、&lt;code&gt;zh_CN&lt;/code&gt;、&lt;code&gt;ja&lt;/code&gt;）。&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;hr /&gt;
&lt;h2&gt;3. 文章加密&lt;/h2&gt;
&lt;p&gt;Shirone 提供客户端文章加密。对于私人日志或受限文章，可在 frontmatter 中指定密码：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;---
title: &quot;Private Research Notes&quot;
published: 2026-08-26
encrypted: true
password: &quot;your-secret-passphrase&quot;
passwordHint: &quot;Favorite anime character&quot;
hideHomeContent: true
---
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;encrypted&lt;/code&gt;：设为 &lt;code&gt;true&lt;/code&gt; 以启用加密；&lt;/li&gt;
&lt;li&gt;&lt;code&gt;password&lt;/code&gt;：用于解锁文章的通关短语字符串或数字；&lt;/li&gt;
&lt;li&gt;&lt;code&gt;passwordHint&lt;/code&gt;：在密码输入表单上方显示的可选提示；&lt;/li&gt;
&lt;li&gt;&lt;code&gt;hideHomeContent&lt;/code&gt;：在首页隐藏字数统计与内容预览，防止数据泄露。&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h2&gt;4. 组织文章文件&lt;/h2&gt;
&lt;p&gt;Shirone 同时支持基于文件夹的同布局与单文件两种布局：&lt;/p&gt;
&lt;h3&gt;文件夹结构（推荐用于本地资源）&lt;/h3&gt;
&lt;p&gt;将文章与其媒体资源放在一起，便于管理资源：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;src/content/posts/
├── my-great-post/
│   ├── index.md           &amp;lt;-- Post content
│   ├── cover.webp         &amp;lt;-- Cover image (image: &quot;./cover.webp&quot;)
│   └── diagram.png        &amp;lt;-- Inline illustration referenced in markdown
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;单文件结构（轻量散文）&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;src/content/posts/
├── hello-world.md
└── quick-thoughts.md
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2&gt;5. 丰富的 Markdown 与 MDX 扩展&lt;/h2&gt;
&lt;p&gt;Shirone 开箱即用地内置了现代 Markdown 扩展：&lt;/p&gt;
&lt;h3&gt;5.1 提示框&lt;/h3&gt;
&lt;p&gt;使用容器指令来添加注释、提示、警告与提醒：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::tip
Use admonition containers to highlight key takeaways or best practices.
:::

:::warning
Use warning containers to signal potential pitfalls or breaking changes.
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;5.2 GitHub 仓库卡片&lt;/h3&gt;
&lt;p&gt;使用指令语法嵌入实时、样式精美的 GitHub 仓库卡片：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;::github{repo=&quot;LyraVoid/Shirone&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;::github{repo=&quot;LyraVoid/Shirone&quot;}&lt;/p&gt;
&lt;h3&gt;5.3 富表现力代码块&lt;/h3&gt;
&lt;p&gt;增强代码块具备语法高亮、文件名徽章、行号以及选择性行高亮：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// Dynamic HCT color token derivation
import { argbFromHex, themeFromSourceColor } from &quot;@material/material-color-utilities&quot;;

const theme = themeFromSourceColor(argbFromHex(&quot;#f472b6&quot;));
console.log(&quot;Primary color token:&quot;, theme.schemes.light.primary);
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;5.4 数学排版（KaTeX）&lt;/h3&gt;
&lt;p&gt;在 Markdown 中直接渲染优雅的 LaTeX 数学公式：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;行内公式&lt;/strong&gt;： $E = mc^2$ 或欧拉公式 $e^{i\pi} + 1 = 0$。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;块级公式&lt;/strong&gt;：&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;$$
\int_{-\infty}^{\infty} e^{-x^2} , dx = \sqrt{\pi}
$$&lt;/p&gt;
&lt;h3&gt;5.5 Mermaid 图&lt;/h3&gt;
&lt;p&gt;用纯文本创建流程图、时序图与架构图：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sequenceDiagram
    autonumber
    actor Visitor as Visitor
    participant Page as Shirone Page
    participant Swup as Swup Container
    participant Audio as Persistent Shell

    Visitor-&amp;gt;&amp;gt;Page: Click Navigation Link
    Page-&amp;gt;&amp;gt;Swup: Trigger Seamless Transition
    Swup-&amp;gt;&amp;gt;Page: Replace #swup-container
    Note over Audio: Background music plays continuously
    Page--&amp;gt;&amp;gt;Visitor: New Page Rendered
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;5.6 图片画廊与 Fancybox 灯箱&lt;/h3&gt;
&lt;p&gt;图片自动与 Fancybox 集成，支持无损缩放、平移手势与全屏预览：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;![Cover preview](./cover.jpeg)
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;h2&gt;6. 后续步骤与自定义&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;站点配置&lt;/strong&gt;：在 &lt;code&gt;src/config/siteConfig.ts&lt;/code&gt; 与 &lt;a href=&quot;https://github.com/LyraVoid/Shirone/blob/main/src/config/README.md&quot;&gt;&lt;code&gt;src/config/README.md&lt;/code&gt;&lt;/a&gt; 中了解全局设置。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;设计令牌&lt;/strong&gt;：在 &lt;code&gt;DESIGN.md&lt;/code&gt; 与 &lt;code&gt;docs/m3e-standard.md&lt;/code&gt; 中探索令牌与调色板。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;反馈与社区&lt;/strong&gt;：在 &lt;a href=&quot;https://github.com/LyraVoid/Shirone/issues&quot;&gt;GitHub Issues&lt;/a&gt; 上分享你的想法与问题。&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item><item><title>🔒 文章密码保护演示</title><link>https://xiaobuhui.xyz/posts/encrypted-demo/</link><guid isPermaLink="true">https://xiaobuhui.xyz/posts/encrypted-demo/</guid><description>该文章内容已加密，请输入密码后查看。</description><pubDate>Thu, 20 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;em&gt;🔒 本文已加密保护，请访问博客网站输入密码阅读全文。&lt;/em&gt;&lt;/p&gt;</content:encoded></item><item><title>扩展语法总览</title><link>https://xiaobuhui.xyz/posts/markdown-enhancements/</link><guid isPermaLink="true">https://xiaobuhui.xyz/posts/markdown-enhancements/</guid><description>主题自定义的扩展语法、写作组件与配套写法。</description><pubDate>Wed, 19 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Shirone 提供了一套主题专属的 Markdown 扩展与自定义语法容器。基于原生的统一 AST 处理流水线构建，所有扩展在站点构建时即渲染为无障碍、语义化的 HTML，且具备&lt;strong&gt;零客户端 JavaScript 注水开销&lt;/strong&gt;与 &lt;strong&gt;100% M3E 设计令牌对齐&lt;/strong&gt;。&lt;/p&gt;
&lt;h2&gt;文件树&lt;/h2&gt;
&lt;p&gt;文件树可将多层级的项目结构、源码目录层级与终端目录输出，转换为紧凑、可交互的树状视图，并带有自动扩展名图标、差异高亮与可折叠分支。&lt;/p&gt;
&lt;h3&gt;1. 嵌套列表语法（&lt;code&gt;:::file-tree&lt;/code&gt;）&lt;/h3&gt;
&lt;p&gt;当以 Markdown 嵌套列表的形式直接书写文件层级时，使用 &lt;code&gt;:::file-tree&lt;/code&gt; 块指令。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::file-tree{title=&quot;Shirone source tree&quot;}
- src
  - components/
    - ++ Navigation.svelte # added component
    - -- Button.astro # removed component
  - content
    - posts/
      - markdown-enhancements.md
  - layouts/
    - PostLayout.astro
  - plugins
    - markdown/
      - rehype-file-tree.mjs
  - styles
    - markdown/
      - trees.css
  - **content.config.ts** # important file
- public/
  - favicon.svg
- package.json
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::file-tree{title=&quot;Shirone source tree&quot;}&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;src
&lt;ul&gt;
&lt;li&gt;components/
&lt;ul&gt;
&lt;li&gt;++ Navigation.svelte # added component&lt;/li&gt;
&lt;li&gt;-- Button.astro # removed component&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;content
&lt;ul&gt;
&lt;li&gt;posts/
&lt;ul&gt;
&lt;li&gt;markdown-enhancements.md&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;layouts/
&lt;ul&gt;
&lt;li&gt;PostLayout.astro&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;plugins
&lt;ul&gt;
&lt;li&gt;markdown/
&lt;ul&gt;
&lt;li&gt;rehype-file-tree.mjs&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;styles
&lt;ul&gt;
&lt;li&gt;markdown/
&lt;ul&gt;
&lt;li&gt;trees.css&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;content.config.ts&lt;/strong&gt; # important file&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;public/
&lt;ul&gt;
&lt;li&gt;favicon.svg&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;package.json
:::&lt;/li&gt;
&lt;/ul&gt;
&lt;h4&gt;编写规则与标记&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;差异状态&lt;/strong&gt;：在条目前加上 &lt;code&gt;++&lt;/code&gt;（绿色背景与徽标）或 &lt;code&gt;--&lt;/code&gt;（红色背景与删除线）来高亮变更。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;注释&lt;/strong&gt;：跟在 &lt;code&gt;#&lt;/code&gt; 之后的任意文本会渲染为静音、右对齐的行内注释。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;强调&lt;/strong&gt;：用 &lt;code&gt;**bold**&lt;/code&gt; 包裹文件名，可使关键文件获得醒目的视觉权重。&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;可折叠文件夹&lt;/strong&gt;：由嵌套列表项推断出的目录默认展开。添加尾部斜杠（如 &lt;code&gt;components/&lt;/code&gt;）可创建折叠目录，读者可通过点击或键盘导航展开。&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h3&gt;2. 终端输出语法（&lt;code&gt;```file-tree&lt;/code&gt;）&lt;/h3&gt;
&lt;p&gt;当你已通过 &lt;code&gt;tree&lt;/code&gt; 等命令行工具生成目录树文本时，可直接粘贴进 &lt;code&gt;file-tree&lt;/code&gt; 围栏代码块。Unicode 分支字符（&lt;code&gt;├──&lt;/code&gt;, &lt;code&gt;└──&lt;/code&gt;, &lt;code&gt;│&lt;/code&gt;）与 ASCII 分支都会自动解析。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;```file-tree title=&quot;Build output&quot; icon=&quot;simple&quot;
dist
├── _astro/
│   ├── index.css
│   └── page.js
└── favicon.ico
```
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;dist
├── _astro/
│   ├── index.css
│   └── page.js
└── favicon.ico
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;配置选项&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;title=&quot;string&quot;&lt;/code&gt;：为树设置自定义标题与无障碍标签。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;icon=&quot;colored&quot; | &quot;simple&quot;&lt;/code&gt;：在多色扩展名图标（&lt;code&gt;colored&lt;/code&gt;，默认）与极简单色图标（&lt;code&gt;simple&lt;/code&gt;）之间选择。&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h2&gt;代码树&lt;/h2&gt;
&lt;p&gt;交互式代码树将左侧的多层级文件导航面板与右侧的即时代码面板切换相结合，为多文件示例、模块或整个目录的导读提供类 IDE 的阅读体验。&lt;/p&gt;
&lt;h3&gt;1. 容器语法（&lt;code&gt;:::code-tree&lt;/code&gt;）&lt;/h3&gt;
&lt;p&gt;在 &lt;code&gt;:::code-tree&lt;/code&gt; 块指令内组合多个围栏代码块。每个代码块通过 &lt;code&gt;title=&quot;path/to/file&quot;&lt;/code&gt; 指定其路径。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::code-tree{title=&quot;Shirone Component Demo&quot; height=&quot;380px&quot; entry=&quot;src/Button.svelte&quot;}
```svelte title=&quot;src/Button.svelte&quot;
&amp;lt;script lang=&quot;ts&quot;&amp;gt;
  let { label = &quot;Click me&quot; } = $props();
&amp;lt;/script&amp;gt;

&amp;lt;button class=&quot;m3-btn&quot;&amp;gt;{label}&amp;lt;/button&amp;gt;
```

```stylus title=&quot;src/styles/button.styl&quot;
.m3-btn
  background: var(--primary)
  color: var(--on-primary)
  border-radius: var(--shape-corner-m)
```

```json title=&quot;package.json&quot;
{
  &quot;name&quot;: &quot;button-demo&quot;,
  &quot;version&quot;: &quot;1.0.0&quot;
}
```
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::code-tree{title=&quot;Shirone Component Demo&quot; height=&quot;380px&quot; entry=&quot;src/Button.svelte&quot;}&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;script lang=&quot;ts&quot;&amp;gt;
  let { label = &quot;Click me&quot; } = $props();
&amp;lt;/script&amp;gt;

&amp;lt;button class=&quot;m3-btn&quot;&amp;gt;{label}&amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;.m3-btn
  background: var(--primary)
  color: var(--on-primary)
  border-radius: var(--shape-corner-m)
&lt;/code&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;code&gt;{
  &quot;name&quot;: &quot;button-demo&quot;,
  &quot;version&quot;: &quot;1.0.0&quot;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::&lt;/p&gt;
&lt;h4&gt;配置与标记&lt;/h4&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;title=&quot;string&quot;&lt;/code&gt;：设置代码树的标题与无障碍标签。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;height=&quot;string&quot;&lt;/code&gt;：设置桌面视图的高度（默认 &lt;code&gt;420px&lt;/code&gt;，如 &lt;code&gt;380px&lt;/code&gt;、&lt;code&gt;26rem&lt;/code&gt;）。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;entry=&quot;filepath&quot;&lt;/code&gt;：指定首次加载时处于激活状态的文件。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;icon=&quot;colored&quot; | &quot;simple&quot;&lt;/code&gt;：在彩色与极简单色文件图标之间切换。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;:active&lt;/code&gt;：在任意围栏代码块上添加 &lt;code&gt;:active&lt;/code&gt;，将其指定为默认激活的选项卡。&lt;/li&gt;
&lt;/ul&gt;
&lt;hr /&gt;
&lt;h3&gt;2. 本地目录自动导入（&lt;code&gt;@[code-tree]&lt;/code&gt;）&lt;/h3&gt;
&lt;p&gt;直接指向工作区中的任意本地目录路径，即可在构建时自动扫描并生成交互式代码树，无需手动复制文件内容。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;@[code-tree title=&quot;Anime Utilities&quot; entry=&quot;status.ts&quot;](/src/utils/anime)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;@&lt;a href=&quot;/src/config&quot;&gt;code-tree title=&quot;Site Configuration&quot; entry=&quot;siteConfig.ts&quot;&lt;/a&gt;&lt;/p&gt;
</content:encoded></item><item><title>第一篇碎碎念</title><link>https://xiaobuhui.xyz/posts/first-musings/</link><guid isPermaLink="true">https://xiaobuhui.xyz/posts/first-musings/</guid><description>博客开张，先写点没头没尾的碎碎念。</description><pubDate>Sat, 12 Sep 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&amp;lt;!--
这是「一些碎碎念」分类下的首篇文章。
它存在的主要目的，是让这个分类出现在站点的分类导航里（没有文章的分类不会显示）。
你可以直接改写这一篇，也可以删掉后自己另写一篇——只要该分类下还有文章，分类就会一直显示。
--&amp;gt;&lt;/p&gt;
&lt;p&gt;折腾一个自己的小站，往往是从一个很简单的念头开始的：想找个地方，把脑子里那些零零碎碎的东西存下来。&lt;/p&gt;
&lt;p&gt;它们大多成不了正式的文章——不够系统，也不够完整。可能只是今天看到的一句话、一段没头没尾的联想，或者调试到深夜时突然想通的一个小问题。&lt;/p&gt;
&lt;p&gt;于是就单独开了这么一块地方。&lt;/p&gt;
&lt;p&gt;不追求篇篇有用，也不打算写给谁看。写得动就多写两句，写不动就放张图。&lt;strong&gt;先把想说的说出口，剩下的以后再说。&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;如果你也在折腾自己的小站，欢迎到 &lt;a href=&quot;/about/&quot;&gt;关于我&lt;/a&gt; 找我聊聊踩过的坑。&lt;/p&gt;
</content:encoded></item><item><title>音频阅读器</title><link>https://xiaobuhui.xyz/posts/audio-reader/</link><guid isPermaLink="true">https://xiaobuhui.xyz/posts/audio-reader/</guid><description>按需播放的音频片段组件。</description><pubDate>Sat, 29 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;这些简短的日语语音片段，仿佛是从某个动漫场景的边缘拾取而来：一声戏谑的呼唤、一句明亮的问候、一阵轻微的笑声，还有几句来历不明的台词。它们是情绪采样，而非对话台词稿，所以就让声音本身去承载含义吧。&lt;/p&gt;
&lt;p&gt;音频阅读器会一直保持安静，直到你选择聆听。每个说话人按钮都只在被点击后才加载并播放其片段。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:audio-reader[Clip title]{src=&quot;/assets/audio/filename.wav&quot;}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;片段清单&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Baka&lt;/strong&gt;: :audio-reader[バカ]{src=&quot;/assets/audio/Baka.wav&quot;}&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ciallo&lt;/strong&gt;: :audio-reader[Ciallo！！]{src=&quot;/assets/audio/Ciallo.wav&quot;}&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Ehe&lt;/strong&gt;: :audio-reader[调侃的意味]{src=&quot;/assets/audio/Ehe.wav&quot;}&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Imoi&lt;/strong&gt;: :audio-reader[イモい]{src=&quot;/assets/audio/Imoi.wav&quot;}&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Zako&lt;/strong&gt;: :audio-reader[雑魚じゃん、雑魚雑魚]{src=&quot;/assets/audio/Zako.wav&quot;}&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;code&gt;src&lt;/code&gt; 必须使用站点根路径或 HTTPS URL，且指令标签不能为空。无效或不完整的指令会保持为普通 Markdown，不会加载音频阅读器资源。&lt;/p&gt;
</content:encoded></item><item><title>Markdown 折叠面板</title><link>https://xiaobuhui.xyz/posts/collapse-panels/</link><guid isPermaLink="true">https://xiaobuhui.xyz/posts/collapse-panels/</guid><description>把可选读的内容收进折叠面板，让正文保持清爽。</description><pubDate>Fri, 28 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;折叠面板把相关的可选细节收拢在一个紧凑组中。标题与正文保留行内和块级 Markdown，而原生折叠语义让每个面板无需客户端 JavaScript 即可使用。&lt;/p&gt;
&lt;h2&gt;独立面板&lt;/h2&gt;
&lt;p&gt;默认情况下，各项目独立展开。给标题加 &lt;code&gt;:+&lt;/code&gt; 可让该项初始就展开，加 &lt;code&gt;:-&lt;/code&gt; 可让其在组使用 &lt;code&gt;expand&lt;/code&gt; 时保持收起。&lt;/p&gt;
&lt;p&gt;::: collapse&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;环境要求&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;安装依赖前，请使用 Node.js 22 或更高版本，并启用 Corepack。&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;:+ 安装依赖&lt;/p&gt;
&lt;p&gt;在仓库根目录运行工作区包命令。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pnpm.cmd install
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;校验命令&lt;/p&gt;
&lt;p&gt;构建生产产物前，请检查内容流水线。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;pnpm.cmd check:manifest&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;npx.cmd astro check&lt;/code&gt;
:::&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;手风琴模式&lt;/h2&gt;
&lt;p&gt;当只需要保留一个展开项时，添加 &lt;code&gt;accordion&lt;/code&gt;。浏览器直接对原生折叠元素分组，因此打开另一项会关闭上一项，且无需 hydration。&lt;/p&gt;
&lt;p&gt;::: collapse accordion expand&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;expand&lt;/code&gt; 在这里的作用是什么？&lt;/p&gt;
&lt;p&gt;当没有任何项带有 &lt;code&gt;:+&lt;/code&gt; 标记时，它会初始展开第一项。&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;标题可以包含 Markdown 吗？&lt;/p&gt;
&lt;p&gt;可以。标题支持行内 &lt;strong&gt;强调&lt;/strong&gt; 与 &lt;code&gt;code&lt;/code&gt;，面板正文则支持完整的块级 Markdown。&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;在窄屏上会发生什么？&lt;/p&gt;
&lt;p&gt;内容内边距会收紧，长文本自动换行，而内嵌代码保留自身水平滚动区域。
:::&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;编写语法&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;::: collapse accordion
- :+ First title

  First panel content.

- Second title with `code`

  Second panel content.
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;容器必须恰好包含一个顶层无序列表。每个项目都需要一段标题、一个空行以及正文内容。无效或混合的输入会保持为普通可读的 Markdown 列表。&lt;/p&gt;
</content:encoded></item><item><title>Markdown 缩写</title><link>https://xiaobuhui.xyz/posts/markdown-abbreviations/</link><guid isPermaLink="true">https://xiaobuhui.xyz/posts/markdown-abbreviations/</guid><description>定义一次缩写，全文悬停即可看到完整含义。</description><pubDate>Fri, 28 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;缩写让技术写作更加紧凑，同时为需要完整含义的读者保留完整术语。定义后的术语会渲染为原生 &lt;code&gt;abbr&lt;/code&gt; 元素，其含义可在悬停时查看，也可被辅助技术读取。&lt;/p&gt;
&lt;h2&gt;上下文示例&lt;/h2&gt;
&lt;p&gt;以 SSR 优先的输出，能在 JavaScript 运行前就保持初始文档可见。在衡量其阅读体验时，LCP 和 CLS 会揭示首屏可见内容是否既快又稳。&lt;/p&gt;
&lt;p&gt;缩写也可以出现在普通 Markdown 旁边，例如 &lt;strong&gt;SSR&lt;/strong&gt; 指南，但像 &lt;code&gt;SSR&lt;/code&gt; 这样的字面代码以及如 &lt;a href=&quot;https://web.dev/articles/lcp&quot;&gt;LCP 文档&lt;/a&gt; 这样的链接都保持原样。&lt;/p&gt;
&lt;h2&gt;定义术语&lt;/h2&gt;
&lt;p&gt;可将定义放在同一篇 Markdown 文档的任意位置。它们不会渲染为可见段落，只有该文章中匹配的术语才会获得语义缩写处理。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;*[SSR]: Server-Side Rendering
*[LCP]: Largest Contentful Paint
*[CLS]: Cumulative Layout Shift

SSR makes an HTML response available before client code runs.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;*[SSR]: 服务端渲染
*[LCP]: 最大内容绘制
*[CLS]: 累积布局偏移&lt;/p&gt;
&lt;h2&gt;编写边界&lt;/h2&gt;
&lt;p&gt;术语必须以字母或数字开头，可包含字母、数字、句点、下划线、加号和连字符。每条定义仅适用于当前文章；无效或重复的定义会保持为普通 Markdown，而不会静默替换另一条术语。&lt;/p&gt;
</content:encoded></item><item><title>Markdown 片段复用</title><link>https://xiaobuhui.xyz/posts/markdown-includes/</link><guid isPermaLink="true">https://xiaobuhui.xyz/posts/markdown-includes/</guid><description>在构建时把其他 Markdown 文件或片段嵌进当前文章。</description><pubDate>Fri, 28 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Shirone 可以将一个本地 Markdown 文件，或其中一段安全的内容，复用进来。&lt;/p&gt;
&lt;p&gt;&amp;lt;!-- @include: src/content/snippets/include-example.md#public-api --&amp;gt;&lt;/p&gt;
&lt;p&gt;完整文件与行范围形式同样受支持：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;!-- @include: src/content/snippets/include-example.md --&amp;gt;
&amp;lt;!-- @include: src/content/snippets/include-example.md{1-4} --&amp;gt;
&amp;lt;!-- @include: src/content/snippets/include-example.md{5-} --&amp;gt;
&amp;lt;!-- @include: src/content/snippets/include-example.md{-4} --&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;围栏代码内的 include 注释会保持字面原样。&lt;/p&gt;
</content:encoded></item><item><title>Markdown 标记高亮</title><link>https://xiaobuhui.xyz/posts/marker-highlights/</link><guid isPermaLink="true">https://xiaobuhui.xyz/posts/marker-highlights/</guid><description>用标记语法高亮关键词，突出句子里的重点。</description><pubDate>Fri, 28 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;标记高亮能突出某个特定短语，又不会把周围的段落变成独立组件。它们在构建时渲染为原生 &lt;code&gt;&amp;lt;mark&amp;gt;&lt;/code&gt; 元素，并继承当前激活的 M3E 配色系统。&lt;/p&gt;
&lt;h2&gt;默认强调&lt;/h2&gt;
&lt;p&gt;当希望用文章的主色来承载强调时，使用 &lt;code&gt;==text==&lt;/code&gt;。这对于 ==读者在普通段落中需要记住的一个决定== 很有用。&lt;/p&gt;
&lt;p&gt;当短语需要更强的层级时，标记中可以包含 ==嵌套的 &lt;strong&gt;Markdown 强调&lt;/strong&gt;==。&lt;/p&gt;
&lt;h2&gt;语义颜色&lt;/h2&gt;
&lt;p&gt;当含义需要不同的语气角色时，使用后缀。可用的变体有 &lt;code&gt;primary&lt;/code&gt;、&lt;code&gt;secondary&lt;/code&gt;、&lt;code&gt;tertiary&lt;/code&gt;、&lt;code&gt;error&lt;/code&gt; 和 &lt;code&gt;tip&lt;/code&gt;。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;==主色将短语与当前主题关联=={.primary}&lt;/li&gt;
&lt;li&gt;==副色让辅助性的区分保持低调=={.secondary}&lt;/li&gt;
&lt;li&gt;==第三色增添独立的编辑信号=={.tertiary}&lt;/li&gt;
&lt;li&gt;==错误色标识需要修正的情况=={.error}&lt;/li&gt;
&lt;li&gt;==提示色突出实用指导=={.tip}&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;编写语法&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;==Primary marker==
==Secondary marker=={.secondary}
==Tertiary marker=={.tertiary}
==Error marker=={.error}
==Tip marker=={.tip}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;行内代码（如 &lt;code&gt;==literal marker syntax==&lt;/code&gt;）和围栏示例会保持字面原样，因此文档可以解释该语法而不会触发它。&lt;/p&gt;
</content:encoded></item><item><title>Markdown 选项组</title><link>https://xiaobuhui.xyz/posts/option-groups/</link><guid isPermaLink="true">https://xiaobuhui.xyz/posts/option-groups/</guid><description>把并列的方案放进可同步切换的选项组。</description><pubDate>Fri, 28 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;选项组把并列的说明放在一起，无需重复周围的解释。每个选项都接受完整的块级 Markdown，所选值还能与同一页面上的另一个选项组同步。&lt;/p&gt;
&lt;h2&gt;选择包管理器&lt;/h2&gt;
&lt;p&gt;使用 &lt;code&gt;@tab:active&lt;/code&gt; 选择初始选项。&lt;code&gt;#&lt;/code&gt; 后的后缀提供稳定值，但不改变可见标题。&lt;/p&gt;
&lt;p&gt;::: tabs#package-manager&lt;/p&gt;
&lt;p&gt;@tab npm&lt;/p&gt;
&lt;p&gt;使用 npm 安装包：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;npm install astro
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;@tab:active &lt;strong&gt;pnpm&lt;/strong&gt;#pnpm&lt;/p&gt;
&lt;p&gt;使用 pnpm 安装包：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pnpm.cmd add astro
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;@tab Bun#bun&lt;/p&gt;
&lt;p&gt;使用 Bun 安装包：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bun add astro
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::&lt;/p&gt;
&lt;h2&gt;运行项目&lt;/h2&gt;
&lt;p&gt;这个选项组共享 &lt;code&gt;package-manager&lt;/code&gt; 这个 id。选择上面的任何一个选项，都会更新下方对应的命令，并在下次访问时记住该选择。&lt;/p&gt;
&lt;p&gt;::: tabs#package-manager&lt;/p&gt;
&lt;p&gt;@tab npm&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;npm run dev
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;@tab pnpm&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pnpm.cmd dev
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;@tab Bun#bun&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;bun run dev
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::&lt;/p&gt;
&lt;h2&gt;多种可选方案&lt;/h2&gt;
&lt;p&gt;较长的选项行会保持在一行内，并在窄屏上于自身导航区域内滚动。&lt;/p&gt;
&lt;p&gt;::: tabs&lt;/p&gt;
&lt;p&gt;@tab 本地工作站&lt;/p&gt;
&lt;p&gt;开发功能时使用本地工具链。&lt;/p&gt;
&lt;p&gt;@tab 托管预览环境&lt;/p&gt;
&lt;p&gt;发布一个临时预览用于评审。&lt;/p&gt;
&lt;p&gt;@tab 持续集成&lt;/p&gt;
&lt;p&gt;针对每次变更运行确定性校验。&lt;/p&gt;
&lt;p&gt;@tab 生产部署&lt;/p&gt;
&lt;p&gt;将经过验证的产物发布到生产环境。&lt;/p&gt;
&lt;p&gt;@tab 离线恢复流程&lt;/p&gt;
&lt;p&gt;网络不可用时从本地产物恢复。&lt;/p&gt;
&lt;p&gt;:::&lt;/p&gt;
&lt;h2&gt;编写语法&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;::: tabs#package-manager

@tab npm

Use npm instructions here.

@tab:active **pnpm**#pnpm

Use pnpm instructions here.

:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;每个组至少需要两个 &lt;code&gt;@tab&lt;/code&gt; 区块，且每个区块都需要与标记之间用空行分隔的正文内容。无效或不完整的组仍会作为普通 Markdown 保持可读。&lt;/p&gt;
</content:encoded></item><item><title>Markdown 剧透</title><link>https://xiaobuhui.xyz/posts/spoilers/</link><guid isPermaLink="true">https://xiaobuhui.xyz/posts/spoilers/</guid><description>把答案与剧透折叠起来，需要时再展开。</description><pubDate>Fri, 28 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;剧透把简短答案或剧情细节藏起来，却不从文档中移除。悬停、聚焦或激活原生控件即可展开内容。&lt;/p&gt;
&lt;h2&gt;行内细节&lt;/h2&gt;
&lt;p&gt;答案是 :spoiler[&lt;strong&gt;42&lt;/strong&gt;]，而这句话在它周围仍是普通 Markdown。&lt;/p&gt;
&lt;p&gt;剧透可以包含 &lt;code&gt;inline code&lt;/code&gt;，也可以包含 :spoiler[带 &lt;strong&gt;强调&lt;/strong&gt; 的更长细节]。&lt;/p&gt;
&lt;h2&gt;编写语法&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;The answer is :spoiler[42].
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;生成的 HTML 使用带 &lt;code&gt;aria-expanded&lt;/code&gt; 状态的原生按钮。即使没有 JavaScript，悬停与聚焦仍能展开文本；可选的运行时则增加了点击与键盘切换。&lt;/p&gt;
</content:encoded></item><item><title>Markdown 提示框</title><link>https://xiaobuhui.xyz/posts/admonitions/</link><guid isPermaLink="true">https://xiaobuhui.xyz/posts/admonitions/</guid><description>用提示框区分注意事项、警告和可折叠的补充说明。</description><pubDate>Thu, 27 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;提示框让补充信息在视觉上保持独立，同时不打断文章阅读节奏。每种形式都在服务端渲染，并使用同一个紧凑的 M3E 组件。&lt;/p&gt;
&lt;h2&gt;语义变体&lt;/h2&gt;
&lt;p&gt;::: note 部署环境
带空格的写法支持普通自定义标题，同时与参考语法保持兼容。
:::&lt;/p&gt;
&lt;p&gt;:::info
用信息块承载中性背景说明，帮助读者理解所在小节。
:::&lt;/p&gt;
&lt;p&gt;:::tip[既有的 &lt;strong&gt;label&lt;/strong&gt; 语法]
原有的方括号标签仍然可用，并支持行内 Markdown 强调。
:::&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;[!IMPORTANT]
GitHub Alert 语法进入同一套渲染器，因此既有文章保持统一的视觉语言。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;:::warning
运行生产构建前，请检查环境变量。
:::&lt;/p&gt;
&lt;p&gt;:::caution
不要把凭据、本地配置或私钥随示例一起发布。
:::&lt;/p&gt;
&lt;h2&gt;可选详情&lt;/h2&gt;
&lt;p&gt;::: details 查看完整命令
折叠面板使用浏览器原生语义，无需客户端 JavaScript 即可保持键盘可访问。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;npx.cmd astro check
pnpm.cmd build
&lt;/code&gt;&lt;/pre&gt;
&lt;ul&gt;
&lt;li&gt;默认处于折叠状态。&lt;/li&gt;
&lt;li&gt;长代码可在自身代码块内滚动。&lt;/li&gt;
&lt;li&gt;在窄屏上，容器仍保持在文章宽度内。
:::&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;编写语法&lt;/h2&gt;
&lt;pre&gt;&lt;code&gt;:::note[Existing title syntax]
Content
:::

::: warning Plume-compatible title syntax
Content
:::

&amp;gt; [!TIP]
&amp;gt; GitHub Alert syntax

::: details Optional content
Hidden until the reader opens it.
:::
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>内容注释</title><link>https://xiaobuhui.xyz/posts/content-annotations/</link><guid isPermaLink="true">https://xiaobuhui.xyz/posts/content-annotations/</guid><description>给文章加旁注，不打断正常阅读节奏。</description><pubDate>Thu, 27 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;内容注释让补充背景紧贴句子，又不直接打断阅读流。点击小注标记即可展开内容。&lt;/p&gt;
&lt;h2&gt;基础语法&lt;/h2&gt;
&lt;p&gt;在普通正文中加入 &lt;code&gt;[+label]&lt;/code&gt; 引用，然后在文章其它位置定义对应的注释。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;Astro renders most of a page ahead of time and hydrates **interactive islands** [+islands] only when they need to become interactive.

[+islands]:
  An island is an interactive UI component surrounded by static HTML. This keeps the default page lightweight while preserving focused interactivity.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Astro 会提前渲染页面的大部分内容，并仅在 &lt;strong&gt;交互式孤岛&lt;/strong&gt; [+islands] 需要变得可交互时才进行 hydration。&lt;/p&gt;
&lt;p&gt;[+islands]:
孤岛是被静态 HTML 包围的交互式 UI 组件。这让默认页面保持轻量，同时保留聚焦的交互能力。&lt;/p&gt;
&lt;h2&gt;富文本内容&lt;/h2&gt;
&lt;p&gt;定义中可以包含段落、强调、链接、列表和行内代码 &lt;a href=&quot;**%E7%BC%96%E5%86%99%E5%BB%BA%E8%AE%AE**&quot;&gt;+rich-note&lt;/a&gt;，而周围句子照常连贯。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;让首句自成一义。&lt;/li&gt;
&lt;li&gt;当读者可能需要原始出处时，使用链接。&lt;/li&gt;
&lt;li&gt;优先使用简洁的示例，如 &lt;code&gt;client:visible&lt;/code&gt;。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;完整模型请参见 &lt;a href=&quot;https://docs.astro.build/en/concepts/islands/&quot;&gt;Astro 孤岛文档&lt;/a&gt;。&lt;/p&gt;
&lt;h2&gt;多重定义&lt;/h2&gt;
&lt;p&gt;复用同一个标签 &lt;a href=&quot;%E4%BB%8E%E4%BC%9A%E6%94%B9%E5%8F%98%E8%AF%BB%E8%80%85%E4%B8%8B%E4%B8%80%E6%AD%A5%E8%A1%8C%E5%8A%A8%E7%9A%84%E5%86%B3%E7%AD%96%E5%86%99%E8%B5%B7%E3%80%82&quot;&gt;+review&lt;/a&gt;，可在单个标记后呈现一组相关的简短注释。&lt;/p&gt;
&lt;p&gt;诸如 &lt;code&gt;[+missing]&lt;/code&gt; 的未定义引用会保持为普通文本，因此未完成的注释永远不会生成空控件。&lt;/p&gt;
</content:encoded></item><item><title>Markdown 步骤</title><link>https://xiaobuhui.xyz/posts/steps/</link><guid isPermaLink="true">https://xiaobuhui.xyz/posts/steps/</guid><description>把有先后顺序的操作整理成带编号的步骤流。</description><pubDate>Thu, 27 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;对于讲究先后顺序的操作，请用步骤组件。该组件保持文章阅读流完整：一条安静的编号轨道提供定位，而标题、段落、链接、列表和代码仍保留各自原生的 Markdown 角色。&lt;/p&gt;
&lt;h2&gt;有序列表语法&lt;/h2&gt;
&lt;p&gt;把一个 Markdown 有序列表包进 &lt;code&gt;:::steps&lt;/code&gt; 容器中。每个顶层列表项都会成为一步。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::steps[Production deployment]
1. **Clone and prepare the workspace**

   Clone the repository and enter the project directory.

   ```powershell
   git clone https://github.com/LyraVoid/Shirone.git
   Set-Location Shirone
   ```

2. **Install dependencies**

   Use the repository&apos;s pinned package manager.

   ```powershell
   pnpm.cmd install
   ```

3. **Run project checks**

   Confirm Astro diagnostics and TypeScript checks pass.

   ```powershell
   npx.cmd astro check
   pnpm.cmd type-check
   ```

4. **Build the production site**

   Generate the static site and search index.

   ```powershell
   pnpm.cmd build
   ```
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::steps[Production deployment]&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;克隆并准备工作区&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;克隆仓库并进入项目目录。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;git clone https://github.com/LyraVoid/Shirone.git
Set-Location Shirone
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;安装依赖&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;使用仓库锁定的包管理器。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pnpm.cmd install
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;运行项目检查&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;确认 Astro 诊断与 TypeScript 检查均通过。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;npx.cmd astro check
pnpm.cmd type-check
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;构建生产站点&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;生成静态站点与搜索索引。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pnpm.cmd build
&lt;/code&gt;&lt;/pre&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;:::&lt;/p&gt;
&lt;h2&gt;选项&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;:::steps[Title]&lt;/code&gt; 或 &lt;code&gt;title=&quot;Title&quot;&lt;/code&gt; 会添加可见标签与无障碍名称。&lt;/li&gt;
&lt;li&gt;&lt;code&gt;start=4&lt;/code&gt; 会改变首个显示的步号。&lt;/li&gt;
&lt;li&gt;容器必须恰好包含一个有序列表。无效或混合的输入会保持为普通可读的 Markdown，而不会被启发式地解读。&lt;/li&gt;
&lt;li&gt;渲染在站点构建阶段完成，不会引入客户端 JavaScript 或网络请求。&lt;/li&gt;
&lt;/ul&gt;
</content:encoded></item><item><title>MDX 与交互组件</title><link>https://xiaobuhui.xyz/posts/mdx-showcase/</link><guid isPermaLink="true">https://xiaobuhui.xyz/posts/mdx-showcase/</guid><description>在文章里用 MDX 和 Svelte 组件做交互内容。</description><pubDate>Thu, 20 Aug 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;:::tip
&lt;strong&gt;MDX（Markdown + JSX）&lt;/strong&gt; 弥合了静态写作与应用界面之间的鸿沟。在 Shirone 中，作者可以在文章内容里无缝混用动态逻辑、响应式的 Svelte 5 组件与 Material 3 设计令牌。
:::&lt;/p&gt;
&lt;h2&gt;1. Markdown 与 MDX 能力矩阵&lt;/h2&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Feature&lt;/th&gt;
&lt;th&gt;Standard Markdown (&lt;code&gt;.md&lt;/code&gt;)&lt;/th&gt;
&lt;th&gt;Shirone MDX (&lt;code&gt;.mdx&lt;/code&gt;)&lt;/th&gt;
&lt;th&gt;Execution Mode&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;排版与结构&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;完全支持&lt;/td&gt;
&lt;td&gt;完全支持&lt;/td&gt;
&lt;td&gt;静态 SSR&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;代码高亮&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;行号、边框、可折叠&lt;/td&gt;
&lt;td&gt;行号、边框、可折叠&lt;/td&gt;
&lt;td&gt;静态 SSR（富表现力代码块）&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;图表与数学&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Mermaid、KaTeX&lt;/td&gt;
&lt;td&gt;Mermaid、KaTeX&lt;/td&gt;
&lt;td&gt;客户端增强&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;提示框&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;Note、Tip、Important、Warning、Caution&lt;/td&gt;
&lt;td&gt;Note、Tip、Important、Warning、Caution&lt;/td&gt;
&lt;td&gt;静态 SSR&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;M3E 展示原子&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;不支持&lt;/td&gt;
&lt;td&gt;直接集成（``、&lt;code&gt;&amp;lt;Skeleton&amp;gt;&lt;/code&gt;）&lt;/td&gt;
&lt;td&gt;纯 SSR（零客户端 JS）&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;Svelte 5 响应式孤岛&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;不支持&lt;/td&gt;
&lt;td&gt;按需注水（&lt;code&gt;&amp;lt;Button&amp;gt;&lt;/code&gt;、&lt;code&gt;&amp;lt;Switch&amp;gt;&lt;/code&gt;）&lt;/td&gt;
&lt;td&gt;&lt;code&gt;client:visible&lt;/code&gt; 惰性注水&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;反馈与加载原子&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;不支持&lt;/td&gt;
&lt;td&gt;动画变形（&lt;code&gt;&amp;lt;LoadingIndicator&amp;gt;&lt;/code&gt;）&lt;/td&gt;
&lt;td&gt;&lt;code&gt;client:visible&lt;/code&gt; 响应式&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;strong&gt;动态 JSX 表达式&lt;/strong&gt;&lt;/td&gt;
&lt;td&gt;不支持&lt;/td&gt;
&lt;td&gt;原生求值（&lt;code&gt;{authorInfo.ui}&lt;/code&gt;）&lt;/td&gt;
&lt;td&gt;编译期 / 客户端&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;hr /&gt;
&lt;h2&gt;2. 动态表达式与数据映射&lt;/h2&gt;
&lt;p&gt;MDX 允许在文件顶部使用 &lt;code&gt;export const&lt;/code&gt; 声明作用域常量，可在行内求值或在模板中映射：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;核心框架&lt;/strong&gt;：{authorInfo.framework}&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;UI 引擎&lt;/strong&gt;：{authorInfo.ui}&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;设计令牌&lt;/strong&gt;：{authorInfo.tokens}&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;架构模式&lt;/strong&gt;：{authorInfo.architecture}&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;数组与集合可动态渲染为网格布局：&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;grid grid-cols-1 md:grid-cols-2 gap-4 my-6&quot;&amp;gt;
{showcaseItems.map((item, idx) =&amp;gt; (
&amp;lt;div key={item.name} class=&quot;p-4 rounded-xl border border-[var(--outline-variant)] bg-[var(--surface-container-low)]&quot;&amp;gt;
&amp;lt;div class=&quot;flex items-center gap-2 mb-1&quot;&amp;gt;
&amp;lt;span class=&quot;w-6 h-6 rounded-full bg-[var(--primary)] text-[var(--on-primary)] text-xs flex items-center justify-center font-bold&quot;&amp;gt;
{idx + 1}
&amp;lt;/span&amp;gt;
&amp;lt;span class=&quot;font-bold text-[var(--on-surface)]&quot;&amp;gt;{item.name}&amp;lt;/span&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;p class=&quot;text-sm text-[var(--on-surface-variant)] m-0&quot;&amp;gt;{item.desc}&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;
))}
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;3. M3E 展示与布局原语（仅 SSR）&lt;/h2&gt;
&lt;p&gt;根据 Shirone 的组件架构（&lt;code&gt;docs/atomic-structure.md&lt;/code&gt;），无状态展示组件会输出干净、可访问的语义化 HTML，且不带客户端运行时负载。&lt;/p&gt;
&lt;h3&gt;3.1 卡片容器（&lt;code&gt;Card.svelte&lt;/code&gt;）&lt;/h3&gt;
&lt;p&gt;&amp;lt;div class=&quot;grid grid-cols-1 md:grid-cols-3 gap-4 my-6&quot;&amp;gt;
&amp;lt;Card variant=&quot;filled&quot; class=&quot;!p-5&quot;&amp;gt;
&amp;lt;div class=&quot;font-bold text-[var(--primary)] mb-2&quot;&amp;gt;填充卡片&amp;lt;/div&amp;gt;
&amp;lt;div class=&quot;text-sm text-[var(--on-surface-variant)]&quot;&amp;gt;默认容器背景，无投影阴影。适合分组内容块。&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;div class=&quot;font-bold text-[var(--primary)] mb-2&quot;&amp;gt;凸起卡片&amp;lt;/div&amp;gt;
&amp;lt;div class=&quot;text-sm text-[var(--on-surface-variant)]&quot;&amp;gt;一级容器抬升，叠加交互状态层次以增强视觉聚焦。&amp;lt;/div&amp;gt;



&amp;lt;div class=&quot;font-bold text-[var(--primary)] mb-2&quot;&amp;gt;描边卡片&amp;lt;/div&amp;gt;
&amp;lt;div class=&quot;text-sm text-[var(--on-surface-variant)]&quot;&amp;gt;清晰利落的 1px 描边边界，在中性表面上提供干净的分割。&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;h3&gt;3.2 强调条与徽章（&lt;code&gt;AccentBar&lt;/code&gt; 与 &lt;code&gt;Badge&lt;/code&gt;）&lt;/h3&gt;
&lt;p&gt;&amp;lt;div class=&quot;flex items-center gap-4 my-4 p-4 rounded-lg bg-[var(--surface-container-high)]&quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;flex-1&quot;&amp;gt;
&amp;lt;span class=&quot;font-bold text-lg&quot;&amp;gt;系统公告&amp;lt;/span&amp;gt;
&amp;lt;p class=&quot;text-xs text-[var(--on-surface-variant)] m-0&quot;&amp;gt;将 AccentBar 与 Badge 组合，构建醒目的视觉提示框&amp;lt;/p&amp;gt;
&amp;lt;/div&amp;gt;
M3E v0.192
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;h3&gt;3.3 骨架占位（&lt;code&gt;Skeleton.svelte&lt;/code&gt;）&lt;/h3&gt;
&lt;p&gt;用于预览布局骨架或搭建异步状态原型：&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;flex flex-col gap-3 my-6 p-5 rounded-xl border border-[var(--outline-variant)] bg-[var(--surface-container-low)]&quot;&amp;gt;
&amp;lt;div class=&quot;flex items-center gap-3&quot;&amp;gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;div class=&quot;flex flex-col gap-1.5 flex-1&quot;&amp;gt;
  
  
&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;4. 反馈与加载指示器&lt;/h2&gt;
&lt;p&gt;Shirone 具备高保真的 Material 3 Expressive 动效与反馈原子：&lt;/p&gt;
&lt;h3&gt;4.1 变形加载指示器（&lt;code&gt;LoadingIndicator.svelte&lt;/code&gt;）&lt;/h3&gt;
&lt;p&gt;基于 &lt;code&gt;androidx.graphics.shapes&lt;/code&gt; 多边形变形实现，提供平滑的弹簧插值 7 形动画：&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;grid grid-cols-1 md:grid-cols-3 gap-4 my-6 p-6 rounded-2xl bg-[var(--surface-container)] border border-[var(--outline-variant)] text-center&quot;&amp;gt;
&amp;lt;div class=&quot;flex flex-col items-center gap-2&quot;&amp;gt;
&amp;lt;div class=&quot;h-16 flex items-center justify-center&quot;&amp;gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;/div&amp;gt;
&amp;lt;span class=&quot;text-xs text-[var(--on-surface-variant)]&quot;&amp;gt;不确定形状变形&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;flex flex-col items-center gap-2&quot;&amp;gt;
&amp;lt;div class=&quot;h-16 flex items-center justify-center&quot;&amp;gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;/div&amp;gt;
&amp;lt;span class=&quot;text-xs text-[var(--on-surface-variant)]&quot;&amp;gt;内含圆形变体&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;flex flex-col items-center gap-2&quot;&amp;gt;
&amp;lt;div class=&quot;h-16 flex items-center justify-center&quot;&amp;gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;/div&amp;gt;
&amp;lt;span class=&quot;text-xs text-[var(--on-surface-variant)]&quot;&amp;gt;确定进度（68%）&amp;lt;/span&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;h3&gt;4.2 线性与不确定进度（&lt;code&gt;ProgressIndicator.svelte&lt;/code&gt;）&lt;/h3&gt;
&lt;p&gt;&amp;lt;div class=&quot;flex flex-col gap-4 my-6 p-6 rounded-2xl bg-[var(--surface-container)] border border-[var(--outline-variant)]&quot;&amp;gt;
&amp;lt;div class=&quot;flex flex-col gap-2&quot;&amp;gt;
&amp;lt;div class=&quot;flex justify-between text-xs text-[var(--on-surface-variant)]&quot;&amp;gt;
&amp;lt;span&amp;gt;管道编译&amp;lt;/span&amp;gt;
&amp;lt;span&amp;gt;80%&amp;lt;/span&amp;gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;flex flex-col gap-2 mt-2&quot;&amp;gt;
&amp;lt;div class=&quot;text-xs text-[var(--on-surface-variant)]&quot;&amp;gt;连续双线动画&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;5. 交互式 Svelte 5 孤岛&lt;/h2&gt;
&lt;p&gt;使用 &lt;code&gt;client:visible&lt;/code&gt; 声明的组件在进入视口时，会通过 &lt;code&gt;IntersectionObserver&lt;/code&gt; 惰性注水：&lt;/p&gt;
&lt;h3&gt;5.1 按钮矩阵（&lt;code&gt;Button.svelte&lt;/code&gt;）&lt;/h3&gt;
&lt;p&gt;&amp;lt;div class=&quot;flex flex-wrap items-center gap-3 my-6 p-4 rounded-xl border border-[var(--outline-variant)]&quot;&amp;gt;
填充按钮
凸起
色调按钮
描边
文本按钮
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;h3&gt;5.2 过滤芯片与分段按钮（&lt;code&gt;Chips&lt;/code&gt; 与 &lt;code&gt;SegmentedButton&lt;/code&gt;）&lt;/h3&gt;
&lt;p&gt;&amp;lt;div class=&quot;flex flex-col gap-4 my-6 p-6 rounded-2xl bg-[var(--surface-container)] border border-[var(--outline-variant)]&quot;&amp;gt;
&amp;lt;div&amp;gt;
&amp;lt;div class=&quot;text-xs font-bold text-[var(--on-surface-variant)] mb-2&quot;&amp;gt;M3E 过滤芯片&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;div&amp;gt;
&amp;lt;div class=&quot;text-xs font-bold text-[var(--on-surface-variant)] mb-2&quot;&amp;gt;分段控件&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;h3&gt;5.3 开关、复选框与滑块（&lt;code&gt;Switch&lt;/code&gt;、&lt;code&gt;Checkbox&lt;/code&gt;、&lt;code&gt;Slider&lt;/code&gt;）&lt;/h3&gt;
&lt;p&gt;&amp;lt;div class=&quot;flex flex-col gap-4 my-6 p-6 rounded-2xl bg-[var(--surface-container)] border border-[var(--outline-variant)]&quot;&amp;gt;
&amp;lt;div class=&quot;flex items-center justify-between&quot;&amp;gt;
&amp;lt;span class=&quot;font-bold text-sm&quot;&amp;gt;带状态图标的开关&amp;lt;/span&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;flex items-center justify-between&quot;&amp;gt;
&amp;lt;span class=&quot;font-bold text-sm&quot;&amp;gt;选择复选框&amp;lt;/span&amp;gt;
&amp;lt;div class=&quot;flex items-center gap-4&quot;&amp;gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;div class=&quot;flex flex-col gap-2&quot;&amp;gt;
&amp;lt;span class=&quot;font-bold text-sm&quot;&amp;gt;色相光谱滑块&amp;lt;/span&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;h3&gt;5.4 输入控件（&lt;code&gt;TextField.svelte&lt;/code&gt;）&lt;/h3&gt;
&lt;p&gt;&amp;lt;div class=&quot;grid grid-cols-1 md:grid-cols-2 gap-4 my-6&quot;&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;lt;/div&amp;gt;&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;6. Markdown 扩展兼容性&lt;/h2&gt;
&lt;p&gt;Shirone 的 SSOT 统一插件管道保留了与所有 Markdown 扩展的完全兼容：&lt;/p&gt;
&lt;h3&gt;6.1 GitHub 仓库卡片&lt;/h3&gt;
&lt;p&gt;::github{repo=&quot;saicaca/fuwari&quot;}&lt;/p&gt;
&lt;h3&gt;6.2 Mermaid 架构图&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;flowchart TD
    MDX[MDX Source Entry] --&amp;gt; Compiler[&quot;@astrojs/mdx Compiler&quot;]
    Compiler --&amp;gt; Plugins[&quot;Remark / Rehype SSOT Pipeline&quot;]
    Plugins --&amp;gt; Islands[&quot;Svelte 5 Interactive Islands&quot;]
    Islands --&amp;gt; Swup[&quot;Swup Client Navigation Shell&quot;]
    Swup --&amp;gt; Screen[&quot;M3E Expressive Article View&quot;]
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;6.3 数学表达式（LaTeX / KaTeX）&lt;/h3&gt;
&lt;p&gt;行内公式：质能等价 $E = mc^2$ 与高斯积分 $\int_{-\infty}^{\infty} e^{-x^2} dx = \sqrt{\pi}$。&lt;/p&gt;
&lt;p&gt;块级公式：&lt;/p&gt;
&lt;p&gt;$$
\mathcal{L}&lt;em&gt;{M3E} = \sum&lt;/em&gt;{i=1}^{N} \left( \text{Token}_i \cdot \text{ContrastRatio} \right) + \lambda |\text{MotionElegance}|
$$&lt;/p&gt;
&lt;hr /&gt;
&lt;h2&gt;7. 总结&lt;/h2&gt;
&lt;p&gt;MDX 的原生集成让技术作者能够构建丰富、交互式的文档，同时保持 Shirone 极致快速的静态性能。所有组件都遵循 Material 3 Expressive 令牌设计系统，确保一致性、可访问性与视觉和谐。&lt;/p&gt;
</content:encoded></item><item><title>图片网格：语法与完整示例</title><link>https://xiaobuhui.xyz/posts/image-grid-demo/</link><guid isPermaLink="true">https://xiaobuhui.xyz/posts/image-grid-demo/</guid><description>图片网格的参数、裁切、响应式、图注与灯箱完整说明。</description><pubDate>Mon, 13 Jul 2026 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;&lt;code&gt;:::grid&lt;/code&gt; 是博客的图片网格容器指令。它把普通 Markdown 图片排成具有统一长宽比的响应式网格，并自动开启灯箱浏览。可用于文章配图、截图、作品集或小型相册。&lt;/p&gt;
&lt;p&gt;同一相册内的图片使用相同的卡片比例。默认情况下，居中裁切会填满每张卡片并保持每行整齐；点击图片会在灯箱中打开完整的原始图片。每个相册都有自己的灯箱分组，不会与文章中的其它图片混在一起。&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;本文既是功能说明，也是可视化测试页。请在桌面、平板和手机宽度下查看示例，然后点击任意图片以验证灯箱分组。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h2&gt;最简语法&lt;/h2&gt;
&lt;p&gt;在 &lt;code&gt;:::grid&lt;/code&gt; 与结尾的 &lt;code&gt;:::&lt;/code&gt; 之间直接书写 Markdown 图片：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::grid
![Image description](./image-1.webp)

![Image description](./image-2.webp)
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;每张图片必须独占一个段落，图片之间留一个空行。相册内只放图片；段落、列表和代码块请写在容器之外。&lt;/p&gt;
&lt;p&gt;下面是最简语法的效果。不加参数时，网格默认使用三列、&lt;code&gt;16/10&lt;/code&gt; 比例和 &lt;code&gt;cover&lt;/code&gt; 裁切。&lt;/p&gt;
&lt;p&gt;:::grid
&lt;img src=&quot;./landscape-1.webp&quot; alt=&quot;最简语法效果：第一张图片&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./landscape-2.webp&quot; alt=&quot;最简语法效果：第二张图片&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;参数速览&lt;/h2&gt;
&lt;p&gt;在起始指令后的花括号中写全部参数：&lt;code&gt;:::grid{parameter=&quot;value&quot;}&lt;/code&gt;。&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;参数&lt;/th&gt;
&lt;th&gt;允许取值&lt;/th&gt;
&lt;th&gt;默认值&lt;/th&gt;
&lt;th&gt;用途&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;columns&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;整数 &lt;code&gt;1&lt;/code&gt; 到 &lt;code&gt;6&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;桌面端每行的列数。无效取值会回退到 &lt;code&gt;3&lt;/code&gt;。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;aspect&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;正数比例，如 &lt;code&gt;16/9&lt;/code&gt;、&lt;code&gt;3/4&lt;/code&gt; 或 &lt;code&gt;1/1&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;16/10&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;卡片显示的比例，不是原图比例。&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;fit&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;cover&lt;/code&gt;、&lt;code&gt;contain&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;&lt;code&gt;cover&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;图片适配模式。&lt;code&gt;cover&lt;/code&gt; 裁切填满；&lt;code&gt;contain&lt;/code&gt; 保留完整图片，可能留白。&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;完整示例：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::grid{columns=&quot;3&quot; aspect=&quot;16/9&quot; fit=&quot;cover&quot;}
![First image](./image-1.webp &quot;Optional caption&quot;)

![Second image](./image-2.webp &quot;Optional caption&quot;)

![Third image](./image-3.webp &quot;Optional caption&quot;)
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;下面的效果使用了上面的三列横向语法。请对比卡片比例、列数，以及标题优先于 alt 文本作为图注的方式：&lt;/p&gt;
&lt;p&gt;:::grid{columns=&quot;3&quot; aspect=&quot;16/9&quot; fit=&quot;cover&quot;}
&lt;img src=&quot;./landscape-1.webp&quot; alt=&quot;参数示例：第一张横向图片&quot; title=&quot;横向图注 1&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./landscape-2.webp&quot; alt=&quot;参数示例：第二张横向图片&quot; title=&quot;横向图注 2&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./landscape-3.webp&quot; alt=&quot;参数示例：第三张横向图片&quot; title=&quot;横向图注 3&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;图注与 Alt 文本&lt;/h2&gt;
&lt;p&gt;图片的 alt 文本既是无障碍替代文字，也是默认图注。当图片带有可选标题时，则改用标题作为图注：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;![Text used for accessibility](./image.webp &quot;Caption shown below the image&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;在同一行中，图注对齐每张卡片的底部。过长的图注换行不会导致其它图片浮动到不同高度。比例文字如 &lt;code&gt;3:4&lt;/code&gt; 和 &lt;code&gt;16:9&lt;/code&gt; 可直接写在正文、标题和 alt 文本中，无需转义。&lt;/p&gt;
&lt;p&gt;本示例演示了默认 alt 文本图注、显式标题图注，以及较长图注的底部对齐：&lt;/p&gt;
&lt;p&gt;:::grid{columns=&quot;3&quot; aspect=&quot;1/1&quot;}
&lt;img src=&quot;./square-1.webp&quot; alt=&quot;这张图片没有标题，因此 alt 文本即为图注&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./square-2.webp&quot; alt=&quot;带无障碍 alt 文本的第二张方形图片&quot; title=&quot;此标题显示为图注&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./square-3.webp&quot; alt=&quot;3:4 海报的无障碍描述&quot; title=&quot;这是一段较长的图注，用于检查换行时每张卡片的图注是否都保持底部对齐&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;布局与裁切&lt;/h2&gt;
&lt;p&gt;桌面布局使用 &lt;code&gt;columns&lt;/code&gt; 指定的列数。低于 &lt;code&gt;768px&lt;/code&gt; 时网格最多两列；低于 &lt;code&gt;480px&lt;/code&gt; 时切换为一列。卡片外壳固定 &lt;code&gt;aspect&lt;/code&gt; 比例并裁切圆角，图片填满卡片，不带主题的默认图片外边距。&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;选 &lt;code&gt;cover&lt;/code&gt;：推荐默认。图片从中心裁切以填满卡片，使相册外观一致。&lt;/li&gt;
&lt;li&gt;选 &lt;code&gt;contain&lt;/code&gt;：显示完整原图，不裁切。当其与卡片比例不同时，主题背景会透出；适用于不可裁切的图片。&lt;/li&gt;
&lt;li&gt;若要在不留白的情况下保留完整图片，请将 &lt;code&gt;aspect&lt;/code&gt; 设为接近原图比例，或将图片单独放在一个网格中。&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;下面两个示例把相同的竖图放入 &lt;code&gt;16/9&lt;/code&gt; 卡片，分别使用 &lt;code&gt;cover&lt;/code&gt; 和 &lt;code&gt;contain&lt;/code&gt;。前者进行裁切；后者保留完整图片并留出背景空间。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::grid{columns=&quot;3&quot; aspect=&quot;16/9&quot; fit=&quot;cover&quot;}
![Image description](./image-1.webp &quot;Optional caption&quot;)

![Image description](./image-2.webp &quot;Optional caption&quot;)
:::

:::grid{columns=&quot;3&quot; aspect=&quot;16/9&quot; fit=&quot;contain&quot;}
![Image description](./image-1.webp &quot;Optional caption&quot;)

![Image description](./image-2.webp &quot;Optional caption&quot;)
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::grid{columns=&quot;3&quot; aspect=&quot;16/9&quot; fit=&quot;cover&quot;}
&lt;img src=&quot;./default-portrait-1.webp&quot; alt=&quot;Cover 效果一&quot; title=&quot;Cover：居中裁切&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./default-portrait-2.webp&quot; alt=&quot;Cover 效果二&quot; title=&quot;Cover：填满卡片&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./default-portrait-3.webp&quot; alt=&quot;Cover 效果三&quot; title=&quot;Cover：更一致的布局&quot; /&gt;
:::&lt;/p&gt;
&lt;p&gt;:::grid{columns=&quot;3&quot; aspect=&quot;16/9&quot; fit=&quot;contain&quot;}
&lt;img src=&quot;./default-portrait-1.webp&quot; alt=&quot;Contain 效果一&quot; title=&quot;Contain：保留完整原图&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./default-portrait-2.webp&quot; alt=&quot;Contain 效果二&quot; title=&quot;Contain：可能出现留白&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./default-portrait-3.webp&quot; alt=&quot;Contain 效果三&quot; title=&quot;Contain：适用于边缘细节&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;默认配置&lt;/h2&gt;
&lt;p&gt;不带属性时，默认是三列、&lt;code&gt;16/10&lt;/code&gt; 比例和 &lt;code&gt;cover&lt;/code&gt; 裁切。下面三张竖图用于验证默认裁切与图注。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::grid
![Image description](./image-1.webp)

![Image description](./image-2.webp)

![Image description](./image-3.webp)
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::grid
&lt;img src=&quot;./default-portrait-1.webp&quot; alt=&quot;默认配置：竖图一&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./default-portrait-2.webp&quot; alt=&quot;默认配置：竖图二&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./default-portrait-3.webp&quot; alt=&quot;默认配置：竖图三&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;三列竖图：3:4&lt;/h2&gt;
&lt;p&gt;使用 &lt;code&gt;aspect=&quot;3/4&quot;&lt;/code&gt; 时，三张竖图填满比例一致的竖向卡片。若原图比例不同，&lt;code&gt;cover&lt;/code&gt; 会从中心裁切其边缘。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::grid{columns=&quot;3&quot; aspect=&quot;3/4&quot;}
![Portrait image description](./portrait-1.webp)

![Portrait image description](./portrait-2.webp)

![Portrait image description](./portrait-3.webp)
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::grid{columns=&quot;3&quot; aspect=&quot;3/4&quot;}
&lt;img src=&quot;./default-portrait-1.webp&quot; alt=&quot;3:4 测试图一&quot; title=&quot;竖图 1&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./default-portrait-2.webp&quot; alt=&quot;3:4 测试图二&quot; title=&quot;竖图 2&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./default-portrait-3.webp&quot; alt=&quot;3:4 测试图三&quot; title=&quot;竖图 3&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;三列横图：16:9&lt;/h2&gt;
&lt;p&gt;这组在三列布局中演示了常见的视频封面比例。当横图接近卡片比例时，裁切很少。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::grid{columns=&quot;3&quot; aspect=&quot;16/9&quot;}
![Landscape image description](./landscape-1.webp)

![Landscape image description](./landscape-2.webp)

![Landscape image description](./landscape-3.webp)
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::grid{columns=&quot;3&quot; aspect=&quot;16:9&quot;}
&lt;img src=&quot;./feature-landscape-1.webp&quot; alt=&quot;16:9 测试图一&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./feature-landscape-2.webp&quot; alt=&quot;16:9 测试图二&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./feature-landscape-3.webp&quot; alt=&quot;16:9 测试图三&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;两列方图：1:1&lt;/h2&gt;
&lt;p&gt;需要较大的预览卡片时，两列很合适。第三张图片会移到下一行。最后一行保持网格轨道宽度，而不是拉伸图片填满整行。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::grid{columns=&quot;2&quot; aspect=&quot;1/1&quot;}
![Square image description](./square-1.webp)

![Square image description](./square-2.webp)

![Square image description](./square-3.webp)
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::grid{columns=&quot;2&quot; aspect=&quot;1/1&quot;}
&lt;img src=&quot;./mixed-square-1.webp&quot; alt=&quot;1:1 测试图一&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./mixed-square-2.webp&quot; alt=&quot;1:1 测试图二&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./mixed-square-3.webp&quot; alt=&quot;1:1 测试图三&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;四列与 &lt;code&gt;contain&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;&lt;code&gt;fit=&quot;contain&quot;&lt;/code&gt; 不会裁切原图。当图片比例与卡片比例不同时，主题背景会透出。这是有意为之，并非布局问题。它同时验证了四列网格与独立的灯箱分组互不影响。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::grid{columns=&quot;4&quot; aspect=&quot;16/9&quot; fit=&quot;contain&quot;}
![Image description](./image-1.webp)

![Image description](./image-2.webp)

![Image description](./image-3.webp)
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::grid{columns=&quot;4&quot; aspect=&quot;16/9&quot; fit=&quot;contain&quot;}
&lt;img src=&quot;./default-portrait-1.webp&quot; alt=&quot;Contain：竖图一&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./default-portrait-2.webp&quot; alt=&quot;Contain：竖图二&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./default-portrait-3.webp&quot; alt=&quot;Contain：竖图三&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;单列细节图&lt;/h2&gt;
&lt;p&gt;当图片需要更大的阅读尺寸时，单列很合适。它在桌面、平板和手机上都是一列，原图仍可在灯箱中查看。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::grid{columns=&quot;1&quot; aspect=&quot;16/9&quot;}
![Image description](./detail.webp)
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::grid{columns=&quot;1&quot; aspect=&quot;16/9&quot;}
&lt;img src=&quot;./feature-landscape-1.webp&quot; alt=&quot;单列测试图&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;稀疏五列行&lt;/h2&gt;
&lt;p&gt;五列验证了更高的支持列数。只有三张图片时，最后一行保持左对齐，而不是拉伸图片。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::grid{columns=&quot;5&quot; aspect=&quot;1/1&quot;}
![Thumbnail description](./thumb-1.webp)

![Thumbnail description](./thumb-2.webp)

![Thumbnail description](./thumb-3.webp)
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::grid{columns=&quot;5&quot; aspect=&quot;1/1&quot;}
&lt;img src=&quot;./mixed-square-1.webp&quot; alt=&quot;五列测试图一&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./mixed-square-2.webp&quot; alt=&quot;五列测试图二&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./mixed-square-3.webp&quot; alt=&quot;五列测试图三&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;六列中的混合图片&lt;/h2&gt;
&lt;p&gt;六列是当前的最大值。混合横图与竖图可验证 &lt;code&gt;cover&lt;/code&gt; 裁切、窄卡片上的图注，以及密集的桌面布局。就文章可读性而言，通常二到四列更合适。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::grid{columns=&quot;6&quot; aspect=&quot;1/1&quot;}
![Image description](./image-1.webp)

![Image description](./image-2.webp)

![Image description](./image-3.webp)

![Image description](./image-4.webp)

![Image description](./image-5.webp)

![Image description](./image-6.webp)
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::grid{columns=&quot;6&quot; aspect=&quot;1/1&quot;}
&lt;img src=&quot;./default-portrait-1.webp&quot; alt=&quot;六列测试图一&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./default-portrait-2.webp&quot; alt=&quot;六列测试图二&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./default-portrait-3.webp&quot; alt=&quot;六列测试图三&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./feature-landscape-1.webp&quot; alt=&quot;六列测试图四&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./feature-landscape-2.webp&quot; alt=&quot;六列测试图五&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./feature-landscape-3.webp&quot; alt=&quot;六列测试图六&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;四列方图：1:1&lt;/h2&gt;
&lt;p&gt;四张同比例的方形图片是典型四列布局。桌面端在一行显示全部四张；平板收为两列，手机收为一列。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::grid{columns=&quot;4&quot; aspect=&quot;1/1&quot;}
![Square image description](./square-1.webp)

![Square image description](./square-2.webp)

![Square image description](./square-3.webp)

![Square image description](./square-4.webp)
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::grid{columns=&quot;4&quot; aspect=&quot;1/1&quot;}
&lt;img src=&quot;./square-1.webp&quot; alt=&quot;方图一&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./square-2.webp&quot; alt=&quot;方图二&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./square-3.webp&quot; alt=&quot;方图三&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./square-4.webp&quot; alt=&quot;方图四&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;六列横图：16:9&lt;/h2&gt;
&lt;p&gt;六列横图非常适合缩略图预览、作品集和截图索引。即使原图比例略有差异，&lt;code&gt;cover&lt;/code&gt; 也能一致地填满每张 &lt;code&gt;16/9&lt;/code&gt; 卡片。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::grid{columns=&quot;6&quot; aspect=&quot;16/9&quot;}
![Landscape image description](./landscape-1.webp)

![Landscape image description](./landscape-2.webp)

![Landscape image description](./landscape-3.webp)

![Landscape image description](./landscape-4.webp)

![Landscape image description](./landscape-5.webp)

![Landscape image description](./landscape-6.webp)
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::grid{columns=&quot;6&quot; aspect=&quot;16/9&quot;}
&lt;img src=&quot;./landscape-1.webp&quot; alt=&quot;横图一&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./landscape-2.webp&quot; alt=&quot;横图二&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./landscape-3.webp&quot; alt=&quot;横图三&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./landscape-4.webp&quot; alt=&quot;横图四&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./landscape-5.webp&quot; alt=&quot;横图五&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./landscape-6.webp&quot; alt=&quot;横图六&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;三列竖图：3:4&lt;/h2&gt;
&lt;p&gt;这组六张竖图演示了人物、海报或手机截图的常见布局。图片排成两行三列，图注对齐底部。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::grid{columns=&quot;3&quot; aspect=&quot;3/4&quot;}
![Portrait image description](./portrait-1.webp)

![Portrait image description](./portrait-2.webp)

![Portrait image description](./portrait-3.webp)

![Portrait image description](./portrait-4.webp)

![Portrait image description](./portrait-5.webp)

![Portrait image description](./portrait-6.webp)
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::grid{columns=&quot;3&quot; aspect=&quot;3/4&quot;}
&lt;img src=&quot;./portrait-1.webp&quot; alt=&quot;竖图一&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./portrait-2.webp&quot; alt=&quot;竖图二&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./portrait-3.webp&quot; alt=&quot;竖图三&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./portrait-4.webp&quot; alt=&quot;竖图四&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./portrait-5.webp&quot; alt=&quot;竖图五&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./portrait-6.webp&quot; alt=&quot;竖图六&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;边缘关键内容：&lt;code&gt;cover&lt;/code&gt; 与灯箱&lt;/h2&gt;
&lt;p&gt;这些图片在边缘附近含有重要文字或细节。&lt;code&gt;cover&lt;/code&gt; 能保持网格整齐，但可能裁掉这些边缘；点击图片可在灯箱中查看未裁切的原图。对边缘敏感图片请使用清楚的图注，或改用下面的 &lt;code&gt;contain&lt;/code&gt;。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::grid{columns=&quot;3&quot; aspect=&quot;16/9&quot; fit=&quot;cover&quot;}
![Edge-critical content](./critical-1.webp &quot;Open the lightbox to view the complete edge content&quot;)

![Edge-critical content](./critical-2.webp &quot;Open the lightbox to view the complete edge content&quot;)

![Edge-critical content](./critical-3.webp &quot;Open the lightbox to view the complete edge content&quot;)
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::grid{columns=&quot;3&quot; aspect=&quot;16/9&quot; fit=&quot;cover&quot;}
&lt;img src=&quot;./critical-1.webp&quot; alt=&quot;第一张边缘关键图片&quot; title=&quot;打开灯箱查看完整边缘内容&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./critical-2.webp&quot; alt=&quot;第二张边缘关键图片&quot; title=&quot;打开灯箱查看完整边缘内容&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./critical-3.webp&quot; alt=&quot;第三张边缘关键图片&quot; title=&quot;打开灯箱查看完整边缘内容&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;极端比例与 &lt;code&gt;contain&lt;/code&gt;&lt;/h2&gt;
&lt;p&gt;对于横幅、长截图等极端比例的图片，&lt;code&gt;contain&lt;/code&gt; 会显示完整原图。与 &lt;code&gt;cover&lt;/code&gt; 不同，它可能留出主题背景空间，但绝不会裁切内容。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::grid{columns=&quot;3&quot; aspect=&quot;16/9&quot; fit=&quot;contain&quot;}
![Complete screenshot description](./wide-1.webp)

![Complete screenshot description](./wide-2.webp)

![Complete screenshot description](./wide-3.webp)
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::grid{columns=&quot;3&quot; aspect=&quot;16/9&quot; fit=&quot;contain&quot;}
&lt;img src=&quot;./extreme-1.webp&quot; alt=&quot;极端比例图片一&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./extreme-2.webp&quot; alt=&quot;极端比例图片二&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;./extreme-3.webp&quot; alt=&quot;极端比例图片三&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;透明图片&lt;/h2&gt;
&lt;p&gt;透明图片会透出卡片的主题背景。这个单列 &lt;code&gt;contain&lt;/code&gt; 示例便于观察透明区域、原图边缘和灯箱行为。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;:::grid{columns=&quot;1&quot; aspect=&quot;16/9&quot; fit=&quot;contain&quot;}
![Transparent image description](./transparent.webp)
:::
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;:::grid{columns=&quot;1&quot; aspect=&quot;16/9&quot; fit=&quot;contain&quot;}
&lt;img src=&quot;./transparent-1.webp&quot; alt=&quot;透明背景测试图&quot; /&gt;
:::&lt;/p&gt;
&lt;h2&gt;灯箱导航&lt;/h2&gt;
&lt;p&gt;点击网格中任意图片即可打开 Fancybox 灯箱。在其中可缩放、旋转、进入全屏、查看缩略图，并用方向键导航。导航仅限于当前的 &lt;code&gt;:::grid&lt;/code&gt; 容器：例如点击“16:9 测试图一”只会打开该小节中的另外两张横图。&lt;/p&gt;
&lt;p&gt;同一文章中的普通 Markdown 图片仍单独处理；它们不会被加入任何图片网格。&lt;/p&gt;
&lt;h2&gt;检查清单&lt;/h2&gt;
&lt;ol&gt;
&lt;li&gt;每个网格中的图片尺寸一致，图注在卡片下方。&lt;/li&gt;
&lt;li&gt;图片在悬停时轻微放大；点击后可缩放、旋转并用键盘导航。&lt;/li&gt;
&lt;li&gt;点击“16:9 测试图一”时，灯箱只浏览该小节中的另外两张横图。&lt;/li&gt;
&lt;li&gt;低于 768px 时网格最多两列；低于 480px 时为一列。&lt;/li&gt;
&lt;li&gt;“四列与 &lt;code&gt;contain&lt;/code&gt;”中的竖图完整可见，留有空白且不被裁切。&lt;/li&gt;
&lt;li&gt;五列与六列网格在宽屏上保留指定列数，随后按响应式规则收为两列或一列。&lt;/li&gt;
&lt;/ol&gt;
</content:encoded></item><item><title>Mermaid 图表集</title><link>https://xiaobuhui.xyz/posts/markdown-mermaid/</link><guid isPermaLink="true">https://xiaobuhui.xyz/posts/markdown-mermaid/</guid><description>流程图、时序图、数据模型与日程等各类图表示例。</description><pubDate>Thu, 02 May 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;Mermaid 将 Markdown 中的文字描述转化为图表。下面这些示例借助 Shirone 的内容工作流，演示技术文章与项目笔记中常用的图表类型。&lt;/p&gt;
&lt;h2&gt;流程图&lt;/h2&gt;
&lt;p&gt;流程图用于描述一个流程，包括其中的判断以及返回到更早步骤的路径。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;flowchart TD
    accTitle: Article publishing workflow
    accDescr: An article moves through writing, validation, preview, and build before publication. Failed validation returns it for revision.
    Draft[Write Markdown] --&amp;gt; Check{Validation passed?}
    Check --&amp;gt;|No| Revise[Revise article]
    Revise --&amp;gt; Check
    Check --&amp;gt;|Yes| Preview[Preview locally]
    Preview --&amp;gt; Build[Build static page]
    Build --&amp;gt; Publish[Publish]
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;时序图&lt;/h2&gt;
&lt;p&gt;时序图按时间顺序呈现参与者之间的协作。本示例跟随一次 Swup 站内导航，从请求到 Mermaid 渲染。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sequenceDiagram
    accTitle: Diagram rendering after in-site navigation
    accDescr: A reader starts navigation, Swup replaces the article content, and the Mermaid renderer enhances diagrams on the new page.
    actor Reader
    participant Browser
    participant Swup
    participant Content as Article region
    participant Renderer as Mermaid renderer
    Reader-&amp;gt;&amp;gt;Browser: Open another article
    Browser-&amp;gt;&amp;gt;Swup: Start in-site navigation
    Swup-&amp;gt;&amp;gt;Content: Replace page content
    Swup--&amp;gt;&amp;gt;Renderer: Emit content:replace
    Renderer-&amp;gt;&amp;gt;Content: Find Mermaid containers
    Renderer--&amp;gt;&amp;gt;Browser: Insert themed SVGs
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;实体关系图&lt;/h2&gt;
&lt;p&gt;实体关系图用于建模结构化数据，以及作者、文章、标签与评论之间的关联。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;erDiagram
    accTitle: Blog content relationships
    accDescr: Authors write posts, posts receive comments, and join records connect posts to multiple tags.
    AUTHOR ||--o{ POST : writes
    POST ||--o{ COMMENT : receives
    POST ||--o{ POST_TAG : classified_by
    TAG ||--o{ POST_TAG : groups
    AUTHOR {
        string id PK
        string display_name
    }
    POST {
        string slug PK
        string title
        datetime published_at
        string author_id FK
    }
    COMMENT {
        string id PK
        string post_slug FK
        string body
    }
    TAG {
        string id PK
        string label
    }
    POST_TAG {
        string post_slug FK
        string tag_id FK
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;类图&lt;/h2&gt;
&lt;p&gt;类图表达软件设计中的职责、公开方法以及依赖方向。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;classDiagram
    accTitle: Markdown rendering modules
    accDescr: The content pipeline uses a Mermaid plugin to create fallback markup, which the client renderer later enhances into an SVG.
    class ContentPipeline {
        +render(markdown)
        +collectMetadata()
    }
    class MermaidPlugin {
        +transform(codeFence)
        +createFallback()
    }
    class DiagramRenderer {
        +initialize()
        +renderAll()
        +refreshTheme()
    }
    class ThemeTokens {
        +primary
        +surface
        +outline
    }
    ContentPipeline --&amp;gt; MermaidPlugin : uses
    DiagramRenderer --&amp;gt; MermaidPlugin : enhances output
    DiagramRenderer --&amp;gt; ThemeTokens : reads
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;状态图&lt;/h2&gt;
&lt;p&gt;状态图展示对象的生命周期，以及在各状态间触发切换的事件。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;stateDiagram-v2
    accTitle: Article lifecycle
    accDescr: An article moves from draft to review and publication. It may return for revision or eventually be archived.
    [*] --&amp;gt; Draft
    Draft --&amp;gt; InReview : submit
    InReview --&amp;gt; Draft : request changes
    InReview --&amp;gt; Published : approve
    Published --&amp;gt; Draft : retract
    Published --&amp;gt; Archived : archive
    Archived --&amp;gt; [*]
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;XY 图&lt;/h2&gt;
&lt;p&gt;XY 图将柱状与折线结合，用于在同一坐标轴上比较数值与趋势。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;xychart-beta
    accTitle: Six weeks of content performance
    accDescr: Bars show normalized weekly publishing volume, while the line shows normalized reading completion.
    title &quot;Six weeks of content performance&quot;
    x-axis &quot;Week&quot; [1, 2, 3, 4, 5, 6]
    y-axis &quot;Relative score&quot; 0 --&amp;gt; 100
    bar [36, 52, 44, 68, 76, 84]
    line [48, 55, 62, 61, 73, 81]
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;饼图&lt;/h2&gt;
&lt;p&gt;饼图以紧凑的方式对比各类别在整体中所占的比例。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;pie showData
    accTitle: Article topics by share
    accDescr: Engineering accounts for forty percent, design systems for twenty-five percent, and the remainder is split between guides and essays.
    title Article topics by share
    &quot;Engineering&quot; : 40
    &quot;Design systems&quot; : 25
    &quot;Guides&quot; : 20
    &quot;Essays&quot; : 15
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;甘特图&lt;/h2&gt;
&lt;p&gt;甘特图沿日历时间轴排列任务、依赖关系与里程碑。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;gantt
    accTitle: Theme release plan
    accDescr: The release plan moves from requirements and interaction design through component development, testing, and release.
    title Theme release plan
    dateFormat YYYY-MM-DD
    axisFormat %m/%d
    section Design
    Confirm requirements :done, brief, 2024-05-06, 2d
    Refine interactions :done, interaction, after brief, 3d
    section Implementation
    Develop components :active, components, after interaction, 6d
    Write examples :examples, after interaction, 4d
    section Validation
    Automated tests :tests, after components, 3d
    Release :milestone, release, after tests, 0d
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;思维导图&lt;/h2&gt;
&lt;p&gt;思维导图将一个中心主题拓展为相关领域与支撑概念。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;mindmap
  root((Shirone))
    Content experience
      Markdown
      Search
      Diagrams
    Interface system
      M3E tokens
      Responsive layout
      Color schemes
    Engineering quality
      Astro Check
      Playwright
      Accessibility
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;时间线&lt;/h2&gt;
&lt;p&gt;时间线用于归纳重要事件或阶段，而无需给出精确的日历时长。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;timeline
    title Mermaid support evolution
    Pipeline design : Detect Mermaid fences
                    : Preserve source fallback
    Client enhancement : Load the runtime on demand
                       : Apply theme tokens
    Reliability : Support Swup navigation
                : Verify responsive and accessible output
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;用户旅程图&lt;/h2&gt;
&lt;p&gt;用户旅程图结合任务各阶段的动作、参与者与体验评分。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;journey
    accTitle: A reader understanding a technical article
    accDescr: The reader discovers an article, combines prose with diagrams to understand it, and then explores related topics.
    title A reader understanding a technical article
    section Discover
      Browse the article list: 4: Reader
      Choose a topic: 5: Reader
    section Understand
      Read the article: 4: Reader
      Inspect a relationship diagram: 5: Reader
    section Continue
      Open a related article: 4: Reader
      Bookmark the page: 3: Reader
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;Git 图&lt;/h2&gt;
&lt;p&gt;Git 图展示功能分支在合并进主线之前的推进过程。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;gitGraph
    accTitle: Mermaid feature branch history
    accDescr: A feature branch adds the renderer and tests before merging into the main branch for release.
    commit id: &quot;base&quot;
    branch mermaid
    checkout mermaid
    commit id: &quot;add-renderer&quot;
    commit id: &quot;add-tests&quot;
    checkout main
    merge mermaid id: &quot;merge-mermaid&quot;
    commit id: &quot;release&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;看板&lt;/h2&gt;
&lt;p&gt;看板按工作流状态对任务进行分组，便于快速浏览当前进度。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;kanban
  backlog[Backlog]
    docs[Write author documentation]
    examples[Expand example data]
  active[In progress]
    themes[Verify theme adaptation]
  complete[Complete]
    fallback[Source fallback]
    rendering[Client rendering]
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;桑基图&lt;/h2&gt;
&lt;p&gt;桑基图用连线宽度表示流量或其他数量在节点之间的流动。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;sankey-beta
Landing,Reading,720
Discovery,Reading,430
Reading,Explore,360
Reading,Topics,210
Reading,Outbound,140
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;每个示例都使用标准的 &lt;code&gt;mermaid&lt;/code&gt; 代码块。服务端会保留可读的源码标记，浏览器再将其增强为遵循当前主题的 SVG。当主题切换或 Swup 导航到本文时，图表会重新渲染。&lt;/p&gt;
</content:encoded></item><item><title>Markdown 扩展特性</title><link>https://xiaobuhui.xyz/posts/markdown-extended/</link><guid isPermaLink="true">https://xiaobuhui.xyz/posts/markdown-extended/</guid><description>更多 Markdown 语法特性的用法示例。</description><pubDate>Wed, 01 May 2024 00:00:00 GMT</pubDate><content:encoded>&lt;h2&gt;GitHub 仓库卡片&lt;/h2&gt;
&lt;p&gt;你可以添加动态卡片，链接到 GitHub 仓库；页面加载时，仓库信息会从 GitHub API 拉取。&lt;/p&gt;
&lt;p&gt;::github{repo=&quot;Fabrizz/MMM-OnSpotify&quot;}&lt;/p&gt;
&lt;p&gt;用下面的代码创建一个 GitHub 仓库卡片：&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;Mermaid 图表&lt;/h2&gt;
&lt;p&gt;围栏 &lt;code&gt;mermaid&lt;/code&gt; 代码块会被渲染为图表，并遵循当前的配色方案。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;flowchart LR
    accTitle: Markdown rendering pipeline
    accDescr: Markdown source is transformed into semantic HTML and then enhanced as a themed SVG diagram.
    A[Markdown source] --&amp;gt; B[Astro content pipeline]
    B --&amp;gt; C[Semantic HTML]
    C --&amp;gt; D[Themed diagram]
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;提示框&lt;/h2&gt;
&lt;p&gt;支持以下类型的提示框：&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
强调用户在快速浏览时也应留意的信息。
:::&lt;/p&gt;
&lt;p&gt;:::tip
帮助用户更顺利完成的补充信息。
:::&lt;/p&gt;
&lt;p&gt;:::important
用户成功所必需的关键信息。
:::&lt;/p&gt;
&lt;p&gt;:::warning
因潜在风险而需要用户立即关注的重要内容。
:::&lt;/p&gt;
&lt;p&gt;:::caution
某项操作可能带来的负面后果。
:::&lt;/p&gt;
&lt;h3&gt;基础语法&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;自定义标题&lt;/h3&gt;
&lt;p&gt;提示框的标题可以自定义。&lt;/p&gt;
&lt;p&gt;:::note[我的自定义标题]
这是一条带有自定义标题的提示。
:::&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 语法&lt;/h3&gt;
&lt;blockquote&gt;
&lt;p&gt;[!TIP]
&lt;a href=&quot;https://github.com/orgs/community/discussions/16925&quot;&gt;GitHub 语法&lt;/a&gt; 同样受支持。&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;剧透&lt;/h3&gt;
&lt;p&gt;你可以在文字中加入剧透。文字同样支持 &lt;strong&gt;Markdown&lt;/strong&gt; 语法。&lt;/p&gt;
&lt;p&gt;内容 :spoiler[被隐藏了 &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;
&lt;h2&gt;图片宽度与图注&lt;/h2&gt;
&lt;p&gt;独立的图片在其 alt 文本中接受一个可选的 &lt;code&gt;w-N%&lt;/code&gt; 宽度标记，以及一个 Markdown 标题，该标题会作为图片下方居中的图注显示：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/albums/AcgExample/07.webp&quot; alt=&quot;相册示例图 w-50%&quot; title=&quot;半宽图片带图注&quot; /&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;![Image description w-50%](./image.webp &quot;Visible caption&quot;)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;有效宽度范围是 &lt;code&gt;w-1%&lt;/code&gt; 到 &lt;code&gt;w-100%&lt;/code&gt;；无效的标记会保留在 alt 文本中。宽度与图注相互独立——仅设置标题也会生成图注：&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/albums/AcgExample/08.webp&quot; alt=&quot;相册示例图 w-75%&quot; /&gt;&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/images/albums/AcgExample/09.webp&quot; alt=&quot;相册示例图&quot; title=&quot;没有宽度标记的图注&quot; /&gt;&lt;/p&gt;
</content:encoded></item><item><title>代码块示例</title><link>https://xiaobuhui.xyz/posts/expressive-code/</link><guid isPermaLink="true">https://xiaobuhui.xyz/posts/expressive-code/</guid><description>行号、折叠、差异高亮等代码块能力。</description><pubDate>Wed, 10 Apr 2024 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;在这里，我们一起来看看使用 &lt;a href=&quot;https://expressive-code.com/&quot;&gt;Expressive Code&lt;/a&gt; 时代码块的样子。以下示例都基于官方文档，更多细节可以查阅官方文档。&lt;/p&gt;
&lt;h2&gt;Expressive Code&lt;/h2&gt;
&lt;h3&gt;语法高亮&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://expressive-code.com/key-features/syntax-highlighting/&quot;&gt;语法高亮&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;常规语法高亮&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;console.log(&apos;This code is syntax highlighted!&apos;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;渲染 ANSI 转义序列&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;ANSI colors:
- Regular: [31mRed[0m [32mGreen[0m [33mYellow[0m [34mBlue[0m [35mMagenta[0m [36mCyan[0m
- Bold:    [1;31mRed[0m [1;32mGreen[0m [1;33mYellow[0m [1;34mBlue[0m [1;35mMagenta[0m [1;36mCyan[0m
- Dimmed:  [2;31mRed[0m [2;32mGreen[0m [2;33mYellow[0m [2;34mBlue[0m [2;35mMagenta[0m [2;36mCyan[0m

256 colors (showing colors 160-177):
[38;5;160m160 [38;5;161m161 [38;5;162m162 [38;5;163m163 [38;5;164m164 [38;5;165m165[0m
[38;5;166m166 [38;5;167m167 [38;5;168m168 [38;5;169m169 [38;5;170m170 [38;5;171m171[0m
[38;5;172m172 [38;5;173m173 [38;5;174m174 [38;5;175m175 [38;5;176m176 [38;5;177m177[0m

Full RGB colors:
[38;2;34;139;34mForestGreen - RGB(34, 139, 34)[0m

Text formatting: [1mBold[0m [2mDimmed[0m [3mItalic[0m [4mUnderline[0m
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;编辑器与终端框架&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://expressive-code.com/key-features/frames/&quot;&gt;编辑器与终端框架&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;代码编辑器框架&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;console.log(&apos;Title attribute example&apos;)
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;!-- src/content/index.html --&amp;gt;
&amp;lt;div&amp;gt;File name comment example&amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;终端框架&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;echo &quot;This terminal frame has no title&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;pre&gt;&lt;code&gt;Write-Output &quot;This one has a title!&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;覆盖框架类型&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;echo &quot;Look ma, no frame!&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;pre&gt;&lt;code&gt;# Without overriding, this would be a terminal frame
function Watch-Tail { Get-Content -Tail 20 -Wait $args }
New-Alias tail Watch-Tail
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;文本与行标记&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://expressive-code.com/key-features/text-markers/&quot;&gt;文本与行标记&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;标记整行与行范围&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;// Line 1 - targeted by line number
// Line 2
// Line 3
// Line 4 - targeted by line number
// Line 5
// Line 6
// Line 7 - targeted by range &quot;7-8&quot;
// Line 8 - targeted by range &quot;7-8&quot;
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;选择行标记类型（mark、ins、del）&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;function demo() {
  console.log(&apos;this line is marked as deleted&apos;)
  // This line and the next one are marked as inserted
  console.log(&apos;this is the second inserted line&apos;)

  return &apos;this line uses the neutral default marker type&apos;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;为行标记添加标签&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;// labeled-line-markers.jsx
&amp;lt;button
  role=&quot;button&quot;
  {...props}
  value={value}
  className={buttonClassName}
  disabled={disabled}
  active={active}
&amp;gt;
  {children &amp;amp;&amp;amp;
    !active &amp;amp;&amp;amp;
    (typeof children === &apos;string&apos; ? &amp;lt;span&amp;gt;{children}&amp;lt;/span&amp;gt; : children)}
&amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;在独立行上添加长标签&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;// labeled-line-markers.jsx
&amp;lt;button
  role=&quot;button&quot;
  {...props}

  value={value}
  className={buttonClassName}

  disabled={disabled}
  active={active}
&amp;gt;

  {children &amp;amp;&amp;amp;
    !active &amp;amp;&amp;amp;
    (typeof children === &apos;string&apos; ? &amp;lt;span&amp;gt;{children}&amp;lt;/span&amp;gt; : children)}
&amp;lt;/button&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;使用类 diff 语法&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;+this line will be marked as inserted
-this line will be marked as deleted
this is a regular line
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;pre&gt;&lt;code&gt;--- a/README.md
+++ b/README.md
@@ -1,3 +1,4 @@
+this is an actual diff file
-all contents will remain unmodified
 no whitespace will be removed either
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;将语法高亮与类 diff 语法结合&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;  function thisIsJavaScript() {
    // This entire block gets highlighted as JavaScript,
    // and we can still add diff markers to it!
-   console.log(&apos;Old code to be removed&apos;)
+   console.log(&apos;New and shiny code!&apos;)
  }
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;标记行内的个别文本&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;function demo() {
  // Mark any given text inside lines
  return &apos;Multiple matches of the given text are supported&apos;;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;正则表达式&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;console.log(&apos;The words yes and yep will be marked.&apos;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;转义正斜杠&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;echo &quot;Test&quot; &amp;gt; /home/test.txt
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;选择行内标记类型（mark、ins、del）&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;function demo() {
  console.log(&apos;These are inserted and deleted marker types&apos;);
  // The return statement uses the default marker type
  return true;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;自动换行&lt;/h3&gt;
&lt;p&gt;&lt;a href=&quot;https://expressive-code.com/key-features/word-wrap/&quot;&gt;自动换行&lt;/a&gt;&lt;/p&gt;
&lt;h4&gt;为每个代码块配置自动换行&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;// Example with wrap
function getLongString() {
  return &apos;This is a very long string that will most probably not fit into the available space unless the container is extremely wide&apos;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;pre&gt;&lt;code&gt;// Example with wrap=false
function getLongString() {
  return &apos;This is a very long string that will most probably not fit into the available space unless the container is extremely wide&apos;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h4&gt;配置换行后行的缩进&lt;/h4&gt;
&lt;pre&gt;&lt;code&gt;// Example with preserveIndent (enabled by default)
function getLongString() {
  return &apos;This is a very long string that will most probably not fit into the available space unless the container is extremely wide&apos;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;pre&gt;&lt;code&gt;// Example with preserveIndent=false
function getLongString() {
  return &apos;This is a very long string that will most probably not fit into the available space unless the container is extremely wide&apos;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;可折叠区域&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://expressive-code.com/plugins/collapsible-sections/&quot;&gt;可折叠区域&lt;/a&gt;&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;// All this boilerplate setup code will be collapsed
import { someBoilerplateEngine } from &apos;@example/some-boilerplate&apos;
import { evenMoreBoilerplate } from &apos;@example/even-more-boilerplate&apos;

const engine = someBoilerplateEngine(evenMoreBoilerplate())

// This part of the code will be visible by default
engine.doSomething(1, 2, 3, calcFn)

function calcFn() {
  // You can have multiple collapsed sections
  const a = 1
  const b = 2
  const c = a + b

  // This will remain visible
  console.log(`Calculation result: ${a} + ${b} = ${c}`)
  return c
}

// All this code until the end of the block will be collapsed again
engine.closeConnection()
engine.freeMemory()
engine.shutdown({ reason: &apos;End of example boilerplate code&apos; })
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;行号&lt;/h2&gt;
&lt;p&gt;&lt;a href=&quot;https://expressive-code.com/plugins/line-numbers/&quot;&gt;行号&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;为每个代码块显示行号&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;// This code block will show line numbers
console.log(&apos;Greetings from line 2!&apos;)
console.log(&apos;I am on line 3&apos;)
&lt;/code&gt;&lt;/pre&gt;
&lt;hr /&gt;
&lt;pre&gt;&lt;code&gt;// Line numbers are disabled for this block
console.log(&apos;Hello?&apos;)
console.log(&apos;Sorry, do you know what line I am on?&apos;)
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;更改起始行号&lt;/h3&gt;
&lt;pre&gt;&lt;code&gt;console.log(&apos;Greetings from line 5!&apos;)
console.log(&apos;I am on line 6&apos;)
&lt;/code&gt;&lt;/pre&gt;
</content:encoded></item><item><title>Markdown 基础示例</title><link>https://xiaobuhui.xyz/posts/markdown/</link><guid isPermaLink="true">https://xiaobuhui.xyz/posts/markdown/</guid><description>一篇标准 Markdown 文章长什么样。</description><pubDate>Sun, 01 Oct 2023 00:00:00 GMT</pubDate><content:encoded>&lt;h1&gt;一级标题&lt;/h1&gt;
&lt;p&gt;段落之间用一个空行分隔。&lt;/p&gt;
&lt;p&gt;第二段。&lt;em&gt;斜体&lt;/em&gt;、&lt;strong&gt;粗体&lt;/strong&gt; 和 &lt;code&gt;monospace&lt;/code&gt;。项目符号列表
长这样：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;这一个&lt;/li&gt;
&lt;li&gt;那一个&lt;/li&gt;
&lt;li&gt;另一个&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;注意，--- 不考虑星号的情况下 --- 实际正文从左侧第 4 列开始。&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;引用块像这样写。&lt;/p&gt;
&lt;p&gt;如果你愿意，它们可以跨多个段落。&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;用 3 个连字符表示破折号。用 2 个连字符表示范围（例如，&quot;全部在第 12--14 章&quot;）。三个点 ... 会被转换为省略号。
支持 Unicode。☺&lt;/p&gt;
&lt;h2&gt;二级标题&lt;/h2&gt;
&lt;p&gt;下面是一个有序列表：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;第一项&lt;/li&gt;
&lt;li&gt;第二项&lt;/li&gt;
&lt;li&gt;第三项&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;再次注意，实际正文从第 4 列开始（距左侧 4 个字符）。下面是一个代码示例：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;# Let me re-iterate ...
for i in 1 .. 10 { do-something(i) }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;正如你可能猜到的，缩进 4 个空格。顺便一提，如果不想缩进代码块，你也可以使用围栏代码块：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;define foobar() {
    print &quot;Welcome to flavor country!&quot;;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;（这样复制粘贴更方便）。你还可以为围栏代码块加上标记，让 Pandoc 对其做语法高亮：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;import time
# Quick, count to ten!
for i in range(10):
    # (but not *too* quick)
    time.sleep(0.5)
    print i
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;三级标题&lt;/h3&gt;
&lt;p&gt;下面是一个嵌套列表：&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;首先，准备这些食材：&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;胡萝卜&lt;/li&gt;
&lt;li&gt;芹菜&lt;/li&gt;
&lt;li&gt;扁豆&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;烧一些水。&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;把所有东西倒进锅里，然后按下面的算法操作：&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; find wooden spoon
 uncover pot
 stir
 cover pot
 balance wooden spoon precariously on pot handle
 wait 10 minutes
 goto first step (or shut off burner when done)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;别碰木勺，否则它会掉下来。&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;再次注意，文字总是对齐在 4 空格缩进处（包括上面延续第 3 项的最后一行）。&lt;/p&gt;
&lt;p&gt;这里是一个指向 &lt;a href=&quot;http://foo.bar&quot;&gt;一个网站&lt;/a&gt; 的链接、一个指向 &lt;a href=&quot;local-doc.html&quot;&gt;本地文档&lt;/a&gt; 的链接，以及一个指向 &lt;a href=&quot;#an-h2-header&quot;&gt;本文中的小节标题&lt;/a&gt; 的链接。这里还有一个脚注 &lt;a href=&quot;%E8%84%9A%E6%B3%A8%E5%86%85%E5%AE%B9%E5%86%99%E5%9C%A8%E8%BF%99%E9%87%8C%E3%80%82&quot;&gt;^1&lt;/a&gt;。&lt;/p&gt;
&lt;p&gt;表格可以长这样：&lt;/p&gt;
&lt;p&gt;尺寸 材质 颜色&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;9 皮革 棕色
10 大麻 帆布 原色
11 玻璃 透明&lt;/p&gt;
&lt;p&gt;表格：鞋子、其尺码及制作材料&lt;/p&gt;
&lt;p&gt;（以上是表格的图注。）Pandoc 还支持多行表格：&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;关键词 说明&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;红色 日落、苹果以及其他红色或偏红的事物。&lt;/p&gt;
&lt;p&gt;绿色 树叶、青草、青蛙以及其他难以成为的事物。&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;下面是一条水平分隔线。&lt;/p&gt;
&lt;hr /&gt;
&lt;p&gt;下面是一个定义列表：&lt;/p&gt;
&lt;p&gt;苹果
: 适合做苹果酱。
橙子
: 柑橘类！
番茄
: tomatoe 里没有字母 &quot;e&quot;。&lt;/p&gt;
&lt;p&gt;再次，文字缩进 4 个空格。（在每个术语/定义对之间加一个空行，可以让排版更宽松。）&lt;/p&gt;
&lt;p&gt;下面是一个「行块」：&lt;/p&gt;
&lt;p&gt;| 第一行
| 第二行
| 第三行&lt;/p&gt;
&lt;p&gt;图片可以这样指定：&lt;/p&gt;
&lt;p&gt;行内数学公式这样写：$\omega = d\phi / dt$。独立成行的数学公式应单独成行，并用双美元符号包裹：&lt;/p&gt;
&lt;p&gt;$$I = \int \rho R^{2} dV$$&lt;/p&gt;
&lt;p&gt;$$
\begin{equation*}
\pi
=3.1415926535
;8979323846;2643383279;5028841971;6939937510;5820974944
;5923078164;0628620899;8628034825;3421170679;\ldots
\end{equation*}
$$&lt;/p&gt;
&lt;p&gt;另外请注意，你可以用反斜杠转义任何想要原样显示的标点符号，例如：`foo`、*bar* 等。&lt;/p&gt;
</content:encoded></item><item><title>在文章里嵌入视频</title><link>https://xiaobuhui.xyz/posts/video/</link><guid isPermaLink="true">https://xiaobuhui.xyz/posts/video/</guid><description>在文章中嵌入视频的写法。</description><pubDate>Tue, 01 Aug 2023 00:00:00 GMT</pubDate><content:encoded>&lt;p&gt;只需从 YouTube 或其他平台复制嵌入代码，粘贴到 Markdown 文件中即可。&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;---
title: Include Video in the Post
published: 2023-10-19
// ...
---

&amp;lt;iframe width=&quot;100%&quot; height=&quot;468&quot; src=&quot;https://www.youtube.com/embed/5gIf0_xpFPI?si=N1WTorLKL0uwLsU_&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allowfullscreen&amp;gt;&amp;lt;/iframe&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h2&gt;YouTube&lt;/h2&gt;
&lt;p&gt;::youtube{id=&quot;5gIf0_xpFPI&quot; title=&quot;YouTube 视频&quot; preload=&quot;auto&quot;}&lt;/p&gt;
&lt;h2&gt;Bilibili&lt;/h2&gt;
&lt;p&gt;::bilibili{bvid=&quot;BV1fK4y1s7Qf&quot; title=&quot;Bilibili 视频&quot; p=1 preload=&quot;auto&quot;}&lt;/p&gt;
&lt;h2&gt;AcFun&lt;/h2&gt;
&lt;p&gt;::acfun{acid=&quot;ac48649632&quot; title=&quot;AcFun 视频&quot; preload=&quot;auto&quot;}&lt;/p&gt;
&lt;h2&gt;ArtPlayer&lt;/h2&gt;
&lt;p&gt;::artplayer{src=&quot;https://www.pexels.com/download/video/38538991/&quot; title=&quot;Sintel 预告片&quot; preload=&quot;auto&quot;}&lt;/p&gt;
</content:encoded></item></channel></rss>