<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh_CN">
  <title>Shinakiの部屋</title>
  <subtitle>A Material 3 anime blog</subtitle>
  <link href="https://shinaki.pages.dev/" rel="alternate" type="text/html"/>
  <link href="https://shinaki.pages.dev/atom.xml" rel="self" type="application/atom+xml"/>
  <id>https://shinaki.pages.dev/</id>
  <updated>2026-11-10T06:20:39.000Z</updated>
  <entry>
    <title>命令速查</title>
    <link href="https://shinaki.pages.dev/posts/commands/" rel="alternate" type="text/html"/>
    <id>https://shinaki.pages.dev/posts/commands/</id>
    <published>2026-11-10T06:20:39.000Z</published>
    <updated>2026-11-10T06:20:39.000Z</updated>
    <summary>记录了一些常用的命令</summary>
    <content type="html"><![CDATA[<h2>一、日常改完 → 推送（最常用）</h2>
<pre><code># 本地校验（改过代码/配置建议跑；只改文章也建议跑一次 build）
pnpm exec astro check
pnpm build

# 提交
git add -A
git commit -m "post: 新增文章 xxx"     # 或 feat: / fix: / docs: / chore:

# 推送
git push origin main
</code></pre>
<p>推送后 GitHub Actions 会自动构建并发布；Cloudflare（如果已连仓库）也会自动构建 <code>*.pages.dev</code>。</p>
<hr />
<h2>二、只改文章内容时</h2>
<p>文章在 <code>src/content/posts/</code>，新建一篇：</p>
<pre><code>pnpm new-post my-post-name
# 编辑 src/content/posts/my-post-name.md
pnpm build
git add -A
git commit -m "post: my-post-name"
git push origin main
</code></pre>
<hr />
<h2>三、更新追番数据（需要走代理时）</h2>
<pre><code>NODE_USE_ENV_PROXY=1 HTTPS_PROXY=http://127.0.0.1:2080 node scripts/anime/sync.mjs --provider bangumi

# 确认 src/data/anime-snapshots/bangumi.json 有变化后
git add src/data/anime-snapshots/bangumi.json
git commit -m "chore: sync bangumi snapshot"
git push origin main
</code></pre>
<blockquote>
<p>说明：快照文件现在已提交进仓库，Cloudflare 和 GitHub Pages 构建时都会读它；本地 sync 后记得把 json 一起提交。</p>
</blockquote>
<hr />
<h2>四、常见情况</h2>
<h3>push 被拒（远端有新提交）</h3>
<pre><code>git pull --rebase origin main
git push origin main
</code></pre>
<h3><code>git status</code> 突然冒出一大堆没动过的文件</h3>
<p>多半是 Windows 换行（CRLF）差异。先看真实改动再决定：</p>
<pre><code>git diff -w --stat          # 忽略空白后的真实改动
git diff --ignore-cr-at-eol --name-only
</code></pre>
<p>确认是纯换行的话，可以 <code>git checkout -- &lt;那些文件&gt;</code> 还原，别直接 <code>git add -A</code> 把噪声提交进去。</p>
<h3>只想本地预览，不发布</h3>
<pre><code>pnpm dev          # http://localhost:4321
</code></pre>
<h3>Cloudflare 没更新</h3>
<p>去 CF 项目 → Deployments，看最新一次是不是对应刚推的 commit；没有就点 Retry，或者推一个空提交：</p>
<pre><code>git commit --allow-empty -m "chore: trigger deploy"
git push origin main
</code></pre>
<hr />
<h2>五、整合命令</h2>
<pre><code>cd /d/Shirone &amp;&amp; pnpm build &amp;&amp; git add -A &amp;&amp; git commit -m "chore: update site" &amp;&amp; git push origin main
</code></pre>
<p>把 <code>chore: update site</code> 换成实际做的事就行。</p>
<hr />
]]></content>
    <author><name>秋生</name></author>
    <category term="笔记"/>
  </entry>
  <entry>
    <title>Hello World</title>
    <link href="https://shinaki.pages.dev/posts/hello-world/" rel="alternate" type="text/html"/>
    <id>https://shinaki.pages.dev/posts/hello-world/</id>
    <published>2026-11-09T15:39:27.000Z</published>
    <updated>2026-11-09T15:39:27.000Z</updated>
    <summary>每一个博客都从一篇Hello World开始</summary>
    <content type="html"><![CDATA[<p>这里是秋生的第一篇文章。其实我并不知道写什么所以就让AI给我填充一篇了（</p>
<h2>关于 Shirone</h2>
<p>Shirone 是一个基于 Astro 的博客主题，使用 Svelte 5 编写交互组件、Tailwind CSS 4 与 Stylus 组织样式，整体遵循 <strong>Material 3 Expressive</strong> 设计语言。它不只是一个排版外壳：侧边栏、顶栏、文章页、数据页面都由同一套 M3E 组件与设计令牌驱动。</p>
<p>页面切换使用 Swup：顶栏、侧边栏这些持久外壳不会重新渲染，只有内容区域被替换，所以站内跳转没有整页刷新的闪烁。</p>
<h2>设计上的几个选择</h2>
<ul>
<li><strong>设计令牌优先</strong>：颜色、圆角、字号、动效统一走 <code>--shape-corner-*</code>、<code>--m3e-type-*</code>、<code>--m3e-duration-*</code> 这类变量，亮色与暗色主题共用一套结构。</li>
<li><strong>组件分层</strong>：atoms → molecules → organisms → templates，跨层依赖有明确方向，页面只负责编排。</li>
<li><strong>可选功能零负担</strong>：评论、统计、各种小部件都遵循同一条规则——关闭时不产生网络请求、不占布局、不进入首屏包体。</li>
<li><strong>图标服务端渲染</strong>：所有图标在构建期从图标集中生成 SVG，浏览器不会去请求图标接口。</li>
</ul>
<h2>内容能力</h2>
<p>文章用 Markdown 或 MDX 编写，支持草稿、置顶、系列、标签分类、封面与摘要，也可以在 frontmatter 里单独开关评论、覆写版权声明，甚至给单篇文章加密。</p>
<p>主题还扩展了一套作者可直接使用的 Markdown 语法，用来写更“像页面”的内容：</p>
<ul>
<li>提示框、标签页、分步步骤、字段参数卡片</li>
<li>代码树、图片网格与图片尺寸控制</li>
<li>数学公式、Mermaid 图表</li>
<li>剧透、注解、缩写、GitHub 卡片、include 片段</li>
</ul>
<p>这些语法不需要额外开关，写在文章里就会按需加载对应的样式与运行时。</p>
<h2>数据驱动的页面</h2>
<p>除了文章，站点还有一些由数据文件生成的页面：</p>
<table>
<thead>
<tr>
<th>页面</th>
<th>数据来源</th>
</tr>
</thead>
<tbody>
<tr>
<td>追番</td>
<td>Bangumi 收藏快照</td>
</tr>
<tr>
<td>游戏 / 设备</td>
<td><code>src/data/games.ts</code>、<code>src/data/devices.ts</code></td>
</tr>
<tr>
<td>友链 / 项目 / 技能 / 时间线</td>
<td><code>src/data/*.ts</code></td>
</tr>
<tr>
<td>动态</td>
<td><code>src/content/moments/</code></td>
</tr>
</tbody>
</table>
<p>每个页面都可以在 <code>src/config/</code> 里单独启用或关闭；关掉之后，页面与导航入口会一起消失。</p>
<h2>工程实现</h2>
<ul>
<li>静态构建：<code>pnpm build</code> 生成页面，再用 Pagefind 建立全文搜索索引。</li>
<li>内容分离：内容可以留在仓库里，也可以用 <code>CONTENT_DIR</code> 指向另一个内容仓库，构建时再同步进来。</li>
<li>可复用：主题本身也发布为 npm 包 <code>shirones</code>，可以安装到任意 Astro 项目里作为博客层。</li>
</ul>
]]></content>
    <author><name>秋生</name></author>
    <category term="随笔"/>
  </entry>
</feed>
