<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-CN"><generator uri="https://jekyllrb.com/" version="4.4.1">Jekyll</generator><link href="https://glancake.github.io/feed.xml" rel="self" type="application/atom+xml" /><link href="https://glancake.github.io/" rel="alternate" type="text/html" hreflang="zh-CN" /><updated>2026-08-07T16:43:10+08:00</updated><id>https://glancake.github.io/feed.xml</id><title type="html">Glancake’s Blog</title><subtitle>个人技术博客，记录学习与思考。</subtitle><author><name>Glancake</name></author><entry><title type="html">从聊天室到博客：我的 Jekyll 建站之旅</title><link href="https://glancake.github.io/posts/2025/01/15/hello-jekyll/" rel="alternate" type="text/html" title="从聊天室到博客：我的 Jekyll 建站之旅" /><published>2025-01-15T12:00:00+08:00</published><updated>2025-01-15T12:00:00+08:00</updated><id>https://glancake.github.io/posts/2025/01/15/hello-jekyll</id><content type="html" xml:base="https://glancake.github.io/posts/2025/01/15/hello-jekyll/"><![CDATA[<p>从零搭建一个个人博客，在今天的选择实在太多了。你可以用动态的 WordPress、Hexo、Hugo，也可以选择托管平台的 Medium、Notion。但如果你和我一样，想要<strong>完全掌控</strong>数据和样式，又不想花钱买服务器，那么 Jekyll + GitHub Pages 可能是最优雅的解决方案。</p>

<h2 id="为什么选择-jekyll">为什么选择 Jekyll</h2>

<ol>
  <li><strong>零成本托管</strong>：GitHub Pages 免费提供 HTTPS、全球 CDN</li>
  <li><strong>版本控制</strong>：所有文章以 Markdown 存在 Git 仓库中，永远不会丢失</li>
  <li><strong>极简工作流</strong>：写完文章 <code class="language-plaintext highlighter-rouge">git push</code>，自动构建发布</li>
  <li><strong>高度可定制</strong>：从布局到配色，一切由你控制</li>
</ol>

<h2 id="从聊天室到博客">从聊天室到博客</h2>

<p>这个站点之前是一个基于 Firebase 的实时聊天室应用。虽然功能齐全，但作为个人主页，一个博客显然更合适——它可以沉淀内容，而不仅仅是即时通讯。</p>

<p>改造过程并不复杂：</p>

<ul>
  <li>保留 GitHub Pages 的部署流程（<code class="language-plaintext highlighter-rouge">.github/workflows/static.yml</code>）</li>
  <li>用 Jekyll 替换掉原来的 SPA 架构</li>
  <li>将文章数据从 Firebase 迁移到 Markdown 文件</li>
  <li>重新设计了极简阅读风格的样式</li>
</ul>

<h2 id="一些设计决策">一些设计决策</h2>

<h3 id="明暗模式">明暗模式</h3>

<p>我在 CSS 中使用了 <code class="language-plaintext highlighter-rouge">data-theme</code> 属性配合 CSS 变量来实现明暗切换。首次加载时通过 <code class="language-plaintext highlighter-rouge">prefers-color-scheme</code> 媒体查询跟随系统设置，用户手动切换后存入 <code class="language-plaintext highlighter-rouge">localStorage</code> 持久化。</p>

<div class="language-css highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nd">:root</span> <span class="p">{</span>
  <span class="py">--bg</span><span class="p">:</span> <span class="nx">#ffffff</span><span class="p">;</span>
  <span class="py">--text</span><span class="p">:</span> <span class="nx">#2d3436</span><span class="p">;</span>
<span class="p">}</span>

<span class="o">[</span><span class="nt">data-theme</span><span class="o">=</span><span class="s1">"dark"</span><span class="o">]</span> <span class="p">{</span>
  <span class="py">--bg</span><span class="p">:</span> <span class="nx">#1a1a2e</span><span class="p">;</span>
  <span class="py">--text</span><span class="p">:</span> <span class="nx">#e0e0e0</span><span class="p">;</span>
<span class="p">}</span>
</code></pre></div></div>

<h3 id="代码高亮">代码高亮</h3>

<p>Jekyll 默认使用 Rouge 作为代码高亮器。我在样式中定义了浅色和深色两套 token 颜色，确保代码块在两种模式下都有良好的可读性。</p>

<h2 id="接下来的计划">接下来的计划</h2>

<ul class="task-list">
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />添加标签聚合页面</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />集成 Giscus 评论系统</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />优化图片懒加载</li>
  <li class="task-list-item"><input type="checkbox" class="task-list-item-checkbox" disabled="disabled" />添加文章搜索</li>
</ul>

<p>如果你也想搭建类似的博客，不妨从我的<a href="https://github.com/glancake/glancake.github.io">仓库</a> fork 一份开始。</p>]]></content><author><name>Glancake</name></author><category term="博客" /><category term="Jekyll" /><category term="GitHub Pages" /><summary type="html"><![CDATA[记录将 Firebase 聊天室改造为 Jekyll 静态博客的过程与思考。]]></summary></entry><entry><title type="html">Markdown 写作指南：让你的技术文章更易读</title><link href="https://glancake.github.io/posts/2025/01/10/markdown-writing-guide/" rel="alternate" type="text/html" title="Markdown 写作指南：让你的技术文章更易读" /><published>2025-01-10T18:00:00+08:00</published><updated>2025-01-10T18:00:00+08:00</updated><id>https://glancake.github.io/posts/2025/01/10/markdown-writing-guide</id><content type="html" xml:base="https://glancake.github.io/posts/2025/01/10/markdown-writing-guide/"><![CDATA[<p>Markdown 是技术写作者的标配。语法简单，但写出<strong>易读、美观</strong>的文章仍然需要一些技巧。以下是几条我遵循的原则。</p>

<h2 id="标题层级">标题层级</h2>

<p>文章应该有清晰的结构。通常：</p>

<ul>
  <li><code class="language-plaintext highlighter-rouge">#</code> 用作文章标题（由模板自动渲染）</li>
  <li><code class="language-plaintext highlighter-rouge">##</code> 用作主要章节</li>
  <li><code class="language-plaintext highlighter-rouge">###</code> 用作子章节</li>
  <li>避免使用 <code class="language-plaintext highlighter-rouge">####</code> 及以下的深层嵌套——如果内容需要那么多层级，或许该拆成两篇文章</li>
</ul>

<h2 id="代码块">代码块</h2>

<p>始终指定语言以获得正确的语法高亮：</p>

<div class="language-markdown highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="p">```</span><span class="nl">python
</span><span class="k">def</span> <span class="nf">hello</span><span class="p">():</span>
    <span class="nf">print</span><span class="p">(</span><span class="sh">"</span><span class="s">Hello, World!</span><span class="sh">"</span><span class="p">)</span>
<span class="p">```</span>
</code></pre></div></div>

<p>渲染效果：</p>

<div class="language-python highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">def</span> <span class="nf">hello</span><span class="p">():</span>
    <span class="nf">print</span><span class="p">(</span><span class="sh">"</span><span class="s">Hello, World!</span><span class="sh">"</span><span class="p">)</span>
</code></pre></div></div>

<p>行内代码用反引号包裹：<code class="language-plaintext highlighter-rouge">import this</code>。</p>

<h2 id="列表和引用">列表和引用</h2>

<p>无序列表适合并列要点，有序列表适合步骤说明：</p>

<ol>
  <li>第一步</li>
  <li>第二步</li>
  <li>第三步</li>
</ol>

<p>引用块用来强调关键点或引用外部内容：</p>

<blockquote>
  <p>简洁是智慧的灵魂，冗长是肤浅的藻饰。
— 莎士比亚</p>
</blockquote>

<h2 id="链接和图片">链接和图片</h2>

<ul>
  <li>外部链接用 <code class="language-plaintext highlighter-rouge">[文字](URL)</code></li>
  <li>内部链接用 Jekyll 的 <code class="language-plaintext highlighter-rouge">{% link _posts/xxx.md %}</code></li>
  <li>图片加上替代文本：<code class="language-plaintext highlighter-rouge">![描述](URL)</code></li>
</ul>

<h2 id="段落节奏">段落节奏</h2>

<p>一段话不要超过 5 行。长段落让人窒息，适当的空白让阅读更轻松。</p>

<p>善用<strong>粗体</strong>标记关键词，但不要在一段话里用超过 3 次——否则反而没有重点。</p>

<hr />

<p>以上就是我遵循的一些写作习惯。说到底，好的技术文章不在于辞藻华丽，而在于<strong>结构清晰、表达准确</strong>。</p>]]></content><author><name>Glancake</name></author><category term="Markdown" /><category term="写作" /><summary type="html"><![CDATA[分享一些用 Markdown 撰写技术文章的实用技巧与排版建议。]]></summary></entry></feed>