<?xml version="1.0" encoding="utf-8"?><?xml-stylesheet type="text/xsl" href="https://blog-338.pages.dev/atom.xsl"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-CN">
  <id>https://blog-338.pages.dev/</id>
  <title>阿宅的博客</title>
  <subtitle>记录技术、生活与奇思妙想</subtitle>
  <icon>https://blog-338.pages.dev/logo.svg</icon>
  <updated>2026-09-17T17:00:04.364Z</updated>
  <generator>@vuepress/plugin-feed</generator>
  <link rel="self" href="https://blog-338.pages.dev/atom.xml"/>
  <link rel="alternate" href="https://blog-338.pages.dev/"/>
  <category term="技术随笔"/>
  <entry>
    <title type="text">用 VuePress + Cloudflare Pages 搭一个「推上去就上线」的博客</title>
    <id>https://blog-338.pages.dev/posts/01-%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA.html</id>
    <link href="https://blog-338.pages.dev/posts/01-%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA.html"/>
    <updated>2026-09-14T00:08:31.000Z</updated>
    <summary type="html"><![CDATA[<p>前后折腾不到半小时，博客就有了一个能自动发布的完整流水线。记录一下关键决策，省得下次重来。</p>
]]></summary>
    <content type="html"><![CDATA[<p>前后折腾不到半小时，博客就有了一个能自动发布的完整流水线。记录一下关键决策，省得下次重来。</p>
<!-- more -->
<h2 id="为什么是这套组合" tabindex="-1"><a class="header-anchor" href="#为什么是这套组合"><span>为什么是这套组合</span></a></h2>
<table>
<thead>
<tr>
<th>需求</th>
<th>方案</th>
</tr>
</thead>
<tbody>
<tr>
<td>写起来快</td>
<td>Markdown 优先，目录即路由</td>
</tr>
<tr>
<td>好看且不折腾</td>
<td>vuepress-theme-hope，博客/搜索/暗色模式自带</td>
</tr>
<tr>
<td>源码不公开</td>
<td>GitHub 私有仓库</td>
</tr>
<tr>
<td>部署零维护</td>
<td>Cloudflare Pages，绑定 Git 后自动构建</td>
</tr>
<tr>
<td>免费</td>
<td>Pages 免费额度对个人博客绰绰有余</td>
</tr>
</tbody>
</table>
<h2 id="目录结构" tabindex="-1"><a class="header-anchor" href="#目录结构"><span>目录结构</span></a></h2>
<div class="language- line-numbers-mode" data-highlighter="shiki" data-ext="" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code" v-pre=""><code class="language-"><span class="line"><span>blog/</span></span>
<span class="line"><span>├── package.json</span></span>
<span class="line"><span>└── src/</span></span>
<span class="line"><span>    ├── .vuepress/</span></span>
<span class="line"><span>    │   ├── config.js      # 站点配置</span></span>
<span class="line"><span>    │   ├── theme.js       # 主题配置</span></span>
<span class="line"><span>    │   ├── navbar.js      # 导航栏</span></span>
<span class="line"><span>    │   ├── sidebar.js     # 侧边栏</span></span>
<span class="line"><span>    │   └── public/        # 静态资源（logo / favicon）</span></span>
<span class="line"><span>    ├── README.md          # 首页</span></span>
<span class="line"><span>    ├── about.md</span></span>
<span class="line"><span>    └── posts/             # 文章都放这里</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="cloudflare-pages-的三行配置" tabindex="-1"><a class="header-anchor" href="#cloudflare-pages-的三行配置"><span>Cloudflare Pages 的三行配置</span></a></h2>
<div class="language- line-numbers-mode" data-highlighter="shiki" data-ext="" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code" v-pre=""><code class="language-"><span class="line"><span>Framework preset : None</span></span>
<span class="line"><span>Build command    : npm run docs:build</span></span>
<span class="line"><span>Build output     : src/.vuepress/dist</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>再加一个环境变量 <code v-pre>NODE_VERSION = 22</code>（VuePress 2 要求 Node ≥ 18，写死版本能避免 CF 默认版本太老导致构建失败）。</p>
<h2 id="私有仓库能不能用" tabindex="-1"><a class="header-anchor" href="#私有仓库能不能用"><span>私有仓库能不能用</span></a></h2>
<p>能。Cloudflare 连 GitHub 时授权一次即可读取私有仓库，站点本身照常公开访问，只是源码不露出来。</p>
<blockquote>
<p>注意：如果你的仓库属于组织，授权时需要组织管理员批准 Cloudflare 的 GitHub App。</p>
</blockquote>
<h2 id="小结" tabindex="-1"><a class="header-anchor" href="#小结"><span>小结</span></a></h2>
<p>写作的摩擦力降到「写完 push」，这件事本身就会让人更愿意写。</p>
]]></content>
    <category term="技术随笔"/>
    <published>2026-09-14T00:00:00.000Z</published>
  </entry>
  <entry>
    <title type="text">当 github.com 连不上时，怎么把代码推上去</title>
    <id>https://blog-338.pages.dev/posts/02-SSH443%E6%8E%A8%E9%80%81.html</id>
    <link href="https://blog-338.pages.dev/posts/02-SSH443%E6%8E%A8%E9%80%81.html"/>
    <updated>2026-09-14T00:08:31.000Z</updated>
    <summary type="html"><![CDATA[<p>本机 <code>github.com</code> 的 HTTPS 握手直接失败，但 <code>api.github.com</code> 和 <code>ssh.github.com:443</code> 都是通的。这种情况下，SSH over 443 是最省事的解法。</p>
]]></summary>
    <content type="html"><![CDATA[<p>本机 <code v-pre>github.com</code> 的 HTTPS 握手直接失败，但 <code v-pre>api.github.com</code> 和 <code v-pre>ssh.github.com:443</code> 都是通的。这种情况下，SSH over 443 是最省事的解法。</p>
<!-- more -->
<h2 id="先诊断-别瞎猜" tabindex="-1"><a class="header-anchor" href="#先诊断-别瞎猜"><span>先诊断，别瞎猜</span></a></h2>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code" v-pre=""><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -o</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /dev/null</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -w</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "%{http_code}\n"</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --max-time</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> 12</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> https://api.github.com</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">curl</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -o</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> /dev/null</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -w</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> "%{http_code}\n"</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> --max-time</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> 12</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> https://github.com</span></span>
<span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">ssh</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -T</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -p</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> 443</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> git@ssh.github.com</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>三条命令能分清三件事：API 通不通、网页/HTTPS 通不通、SSH 隧道通不通。
我这边的结果是 <code v-pre>200 / 000 / Permission denied</code>——说明 443 端口的 SSH 隧道是通的，只是没有授权密钥。</p>
<h2 id="解法-ssh-over-443" tabindex="-1"><a class="header-anchor" href="#解法-ssh-over-443"><span>解法：SSH over 443</span></a></h2>
<p>编辑 <code v-pre>~/.ssh/config</code>：</p>
<div class="language- line-numbers-mode" data-highlighter="shiki" data-ext="" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code" v-pre=""><code class="language-"><span class="line"><span>Host github.com</span></span>
<span class="line"><span>    HostName ssh.github.com</span></span>
<span class="line"><span>    Port 443</span></span>
<span class="line"><span>    User git</span></span>
<span class="line"><span>    IdentityFile C:/Users/haila/.ssh/id_ed25519</span></span>
<span class="line"><span>    IdentitiesOnly yes</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><p>然后把公钥加到 GitHub（Settings → SSH and GPG keys → New SSH key）。</p>
<p>验证：</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code" v-pre=""><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">ssh</span><span style="--shiki-light:#986801;--shiki-dark:#D19A66"> -T</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> git@github.com</span></span>
<span class="line"><span style="--shiki-light:#A0A1A7;--shiki-light-font-style:italic;--shiki-dark:#7F848E;--shiki-dark-font-style:italic"># Hi xxx! You've successfully authenticated...</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div><div class="line-number"></div></div></div><p>之后 remote 用 SSH 地址即可：</p>
<div class="language-bash line-numbers-mode" data-highlighter="shiki" data-ext="bash" style="--shiki-light:#383A42;--shiki-dark:#abb2bf;--shiki-light-bg:#FAFAFA;--shiki-dark-bg:#282c34"><pre class="shiki shiki-themes one-light one-dark-pro vp-code" v-pre=""><code class="language-bash"><span class="line"><span style="--shiki-light:#4078F2;--shiki-dark:#61AFEF">git</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> remote</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> set-url</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> origin</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379"> git@github.com:</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">&#x3C;</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">use</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">r></span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">/</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">&#x3C;</span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">rep</span><span style="--shiki-light:#383A42;--shiki-dark:#ABB2BF">o></span><span style="--shiki-light:#50A14F;--shiki-dark:#98C379">.git</span></span></code></pre>
<div class="line-numbers" aria-hidden="true" style="counter-reset:line-number 0"><div class="line-number"></div></div></div><h2 id="一个坑" tabindex="-1"><a class="header-anchor" href="#一个坑"><span>一个坑</span></a></h2>
<p>如果你的 <code v-pre>~/.ssh/config</code> 里已经写了 <code v-pre>ProxyCommand</code> 指向某个本地中继脚本，而那个脚本没在跑，SSH 会直接 <code v-pre>WinError 10061</code>。
这种情况下直连 <code v-pre>ssh -p 443 git@ssh.github.com</code> 反而能通——远程主机名不匹配 <code v-pre>Host github.com</code>，就不会走那条坏规则。</p>
]]></content>
    <category term="技术随笔"/>
    <published>2026-09-14T00:00:00.000Z</published>
  </entry>
</feed>