<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <author>
    <name>吴锦渠</name>
  </author>
  <generator uri="https://hexo.io/">Hexo</generator>
  <id>https://wjqblog.cn/</id>
  <link href="https://wjqblog.cn/" rel="alternate"/>
  <link href="https://wjqblog.cn/atom.xml" rel="self"/>
  <rights>All rights reserved 2026, 吴锦渠</rights>
  <subtitle>代码 · 笔记 · 思考</subtitle>
  <title>吴锦渠的技术博客</title>
  <updated>2026-10-07T08:53:23.327Z</updated>
  <entry>
    <author>
      <name>吴锦渠</name>
    </author>
    <category term="技术" scheme="https://wjqblog.cn/categories/%E6%8A%80%E6%9C%AF/"/>
    <category term="博客搭建" scheme="https://wjqblog.cn/tags/%E5%8D%9A%E5%AE%A2%E6%90%AD%E5%BB%BA/"/>
    <category term="Hexo" scheme="https://wjqblog.cn/tags/Hexo/"/>
    <category term="Cloudflare" scheme="https://wjqblog.cn/tags/Cloudflare/"/>
    <content>
      <![CDATA[<p>花了两天时间，我从零搭建了自己的个人博客 <a href="https://wjqblog.cn/">wjqblog.cn</a>。总成本 <strong>38 元</strong>（域名两年），其余全部免费。这篇文章记录从安装环境到正式上线的完整过程，给想搭博客的朋友一份能照着走的路线图。</p><span id="more"></span><h2 id="相关网址一览"><a href="#相关网址一览" class="headerlink" title="相关网址一览"></a>相关网址一览</h2><table><thead><tr><th>用途</th><th>地址</th></tr></thead><tbody><tr><td>我的博客主页</td><td><a href="https://wjqblog.cn/">https://wjqblog.cn</a></td></tr><tr><td>文章列表</td><td><a href="https://wjqblog.cn/blog/">https://wjqblog.cn/blog/</a></td></tr><tr><td>文章归档</td><td><a href="https://wjqblog.cn/archives/">https://wjqblog.cn/archives/</a></td></tr><tr><td>RSS 订阅引导页</td><td><a href="https://wjqblog.cn/subscribe/">https://wjqblog.cn/subscribe/</a></td></tr><tr><td>RSS 订阅地址</td><td><a href="https://wjqblog.cn/atom.xml">https://wjqblog.cn/atom.xml</a></td></tr><tr><td>源码仓库（GitHub）</td><td><a href="https://github.com/WJQ-malao/blog">https://github.com/WJQ-malao/blog</a></td></tr><tr><td>我的 Gitee</td><td><a href="https://gitee.com/wujiang-j">https://gitee.com/wujiang-j</a></td></tr><tr><td>Cloudflare 控制台</td><td><a href="https://dash.cloudflare.com/">https://dash.cloudflare.com</a></td></tr><tr><td>腾讯云域名管理</td><td><a href="https://console.cloud.tencent.com/domain">https://console.cloud.tencent.com/domain</a></td></tr><tr><td>Hexo 官方文档</td><td><a href="https://hexo.io/zh-cn/docs/">https://hexo.io/zh-cn/docs/</a></td></tr></tbody></table><h2 id="最终架构"><a href="#最终架构" class="headerlink" title="最终架构"></a>最终架构</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">本地写 Markdown → git push → GitHub 仓库</span><br><span class="line">        ↓（自动触发）</span><br><span class="line">Cloudflare 拉取代码、构建 → 部署上线</span><br></pre></td></tr></table></figure><p>以后每次写完文章，只需 <code>git push</code>，一分钟后网站自动更新。</p><h2 id="第一步：准备环境"><a href="#第一步：准备环境" class="headerlink" title="第一步：准备环境"></a>第一步：准备环境</h2><ol><li>安装 <strong>Node.js</strong>（LTS 版）和 <strong>Git</strong>，官网下载一路默认安装</li><li>注册 <strong>GitHub</strong> 账号和 <strong>Cloudflare</strong> 账号（可用 GitHub 登录）</li></ol><h2 id="第二步：本地搭建-Hexo"><a href="#第二步：本地搭建-Hexo" class="headerlink" title="第二步：本地搭建 Hexo"></a>第二步：本地搭建 Hexo</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">npx hexo-cli init blog     <span class="comment"># 初始化项目</span></span><br><span class="line"><span class="built_in">cd</span> blog</span><br><span class="line">npx hexo s                 <span class="comment"># 本地预览 http://localhost:4000</span></span><br></pre></td></tr></table></figure><p>在 <code>_config.yml</code> 里把语言改成 <code>zh-CN</code>、时区改成 <code>Asia/Shanghai</code>。</p><p>写文章用 <code>npx hexo new &quot;标题&quot;</code>，会在 <code>source/_posts/</code> 生成 Markdown 文件。</p><h2 id="第三步：推送到-GitHub"><a href="#第三步：推送到-GitHub" class="headerlink" title="第三步：推送到 GitHub"></a>第三步：推送到 GitHub</h2><p>在 GitHub 新建一个空仓库（不勾选 README），然后：</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line">git init -b main</span><br><span class="line">git add .</span><br><span class="line">git commit -m <span class="string">&quot;init hexo blog&quot;</span></span><br><span class="line">git remote add origin https://github.com/你的用户名/blog.git</span><br><span class="line">git push -u origin main</span><br></pre></td></tr></table></figure><h2 id="第四步：部署到-Cloudflare-Workers"><a href="#第四步：部署到-Cloudflare-Workers" class="headerlink" title="第四步：部署到 Cloudflare Workers"></a>第四步：部署到 Cloudflare Workers</h2><ol><li>Cloudflare → <strong>Workers &amp; Pages</strong> → Create → 关联 GitHub 仓库</li><li>构建配置：<ul><li>Build command：<code>npm run build</code>（Hexo 自带 <code>&quot;build&quot;: &quot;hexo generate&quot;</code>）</li><li>Deploy command：<code>npx wrangler deploy</code></li></ul></li><li>仓库里添加 <code>wrangler.jsonc</code>，声明静态文件目录：</li></ol><figure class="highlight json"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br></pre></td><td class="code"><pre><span class="line"><span class="punctuation">&#123;</span></span><br><span class="line">  <span class="attr">&quot;name&quot;</span><span class="punctuation">:</span> <span class="string">&quot;blog&quot;</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;compatibility_date&quot;</span><span class="punctuation">:</span> <span class="string">&quot;2025-10-01&quot;</span><span class="punctuation">,</span></span><br><span class="line">  <span class="attr">&quot;assets&quot;</span><span class="punctuation">:</span> <span class="punctuation">&#123;</span> <span class="attr">&quot;directory&quot;</span><span class="punctuation">:</span> <span class="string">&quot;./public&quot;</span> <span class="punctuation">&#125;</span></span><br><span class="line"><span class="punctuation">&#125;</span></span><br></pre></td></tr></table></figure><p>push 之后 Cloudflare 自动构建部署，博客就上线了。</p><h2 id="第五步：踩坑——免费域名国内无法访问"><a href="#第五步：踩坑——免费域名国内无法访问" class="headerlink" title="第五步：踩坑——免费域名国内无法访问"></a>第五步：踩坑——免费域名国内无法访问</h2><p>部署很顺利，但访问时问题来了：</p><ul><li><strong>Cloudflare</strong> 的免费域名 <code>*.workers.dev</code>：国内被 DNS 污染，直接打不开</li><li>改用<strong>腾讯云 EdgeOne Pages</strong>：国内能开，但它的免费域名只有 <strong>3 小时预览有效期</strong>，过期返回 401</li></ul><p>结论：<strong>免费平台 + 免费域名的组合在国内无法长期使用</strong>，想让博客稳定公开访问，必须有自己的域名。</p><h2 id="第六步：买域名并绑定（关键一步）"><a href="#第六步：买域名并绑定（关键一步）" class="headerlink" title="第六步：买域名并绑定（关键一步）"></a>第六步：买域名并绑定（关键一步）</h2><p>注意：买域名 ≠ 买服务器，静态博客托管在免费平台上，永远不需要服务器。</p><h3 id="6-1-腾讯云购买域名"><a href="#6-1-腾讯云购买域名" class="headerlink" title="6.1 腾讯云购买域名"></a>6.1 腾讯云购买域名</h3><ol><li>打开腾讯云<strong>域名注册</strong>页面，在搜索框输入想要的名字（如 <code>wjqblog</code>），逐个后缀查看是否可注册</li><li>选好后缀（<code>.cn</code> 两年 38 元；<code>.com</code> 更通用但贵一些），点击立即购买</li><li><strong>信息模板</strong>：首次购买需要创建，填真实姓名、身份证、邮箱（就是域名实名认证，审核几分钟）</li><li><strong>“搭配购买”的产品全部不勾</strong>——都用不上</li><li>支付后等实名审核通过，域名状态变为”正常”</li></ol><h3 id="6-2-接入-Cloudflare"><a href="#6-2-接入-Cloudflare" class="headerlink" title="6.2 接入 Cloudflare"></a>6.2 接入 Cloudflare</h3><ol><li>Cloudflare 首页 → <strong>Add a site</strong> → <strong>Connect a domain</strong>（不要选 Transfer&#x2F;Buy）</li><li>输入域名（只填 <code>wjqblog.cn</code>，不要加 <code>http://</code> 或 <code>www</code>），其余选项保持默认，点 Continue</li><li>DNS 记录页面<strong>什么都不用加</strong>，直接点 <strong>Continue to activation</strong>，弹窗选 <strong>Confirm</strong></li><li>激活页面会给出<strong>两个 Cloudflare 名称服务器</strong>（形如 <code>xxx.ns.cloudflare.com</code>），复制下来</li></ol><h3 id="6-3-腾讯云修改-DNS-服务器"><a href="#6-3-腾讯云修改-DNS-服务器" class="headerlink" title="6.3 腾讯云修改 DNS 服务器"></a>6.3 腾讯云修改 DNS 服务器</h3><ol><li>腾讯云 → 域名注册 → 我的域名 → 点域名 → <strong>管理</strong></li><li>找到 <strong>DNS 服务器 → 修改</strong> → 选”使用非腾讯云 DNS”</li><li>把默认的两个 dnspod 地址<strong>替换成</strong> Cloudflare 给的两个（<strong>两个都要换，一主一备</strong>）→ 提交</li><li>回 Cloudflare 点 <strong>I updated my nameservers</strong>，等几分钟检测通过，显示 ✓ Active</li></ol><blockquote><p>改 DNS 服务器就是声明”这个域名归 Cloudflare 管”，这是整个接入的核心操作。</p></blockquote><h3 id="6-4-绑定到-Workers-项目"><a href="#6-4-绑定到-Workers-项目" class="headerlink" title="6.4 绑定到 Workers 项目"></a>6.4 绑定到 Workers 项目</h3><ol><li>Cloudflare → <strong>Workers &amp; Pages</strong> → 点已有的 blog 项目（<strong>不要走 Create 新建流程</strong>）</li><li>顶部 <strong>Domains</strong> 标签 → <strong>Add Domain</strong></li><li>Subdomain <strong>留空</strong>（即绑定主域名），Enable for 保持 <strong>Production</strong> → 确认</li></ol><p>HTTPS 证书由 Cloudflare 自动签发，不需要配置任何密钥。</p><p>最后把 <code>_config.yml</code> 里的 <code>url:</code> 改成 <code>https://wjqblog.cn</code>，push 一次收尾。</p><h2 id="日常使用"><a href="#日常使用" class="headerlink" title="日常使用"></a>日常使用</h2><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line">npx hexo new <span class="string">&quot;文章标题&quot;</span>     <span class="comment"># 新建文章</span></span><br><span class="line">npx hexo s                  <span class="comment"># 本地预览</span></span><br><span class="line">git add . &amp;&amp; git commit -m <span class="string">&quot;新增文章&quot;</span> &amp;&amp; git push   <span class="comment"># 发布</span></span><br></pre></td></tr></table></figure><h2 id="经验总结"><a href="#经验总结" class="headerlink" title="经验总结"></a>经验总结</h2><ol><li><strong>免费域名在国内都不靠谱</strong>：workers.dev 被墙、EdgeOne 限 3 小时，一个便宜域名（约 20 元&#x2F;年）是最小成本</li><li><strong>域名安全 &#x3D; 账号安全</strong>：没有密钥要管，保护好腾讯云和 Cloudflare 的账号密码即可</li><li><strong>改 DNS 服务器是域名接入的核心操作</strong>，作用就是声明”这个域名归 Cloudflare 管”</li><li><strong>一切配置都在 Git 仓库里</strong>，改坏了 <code>git revert</code> 回滚，换电脑 <code>git clone</code> 复活</li></ol><p>如果你也想搭一个，照这个流程走一遍，半天就能上线。踩坑欢迎留言交流。</p>]]>
    </content>
    <id>https://wjqblog.cn/2026/10/07/%E4%BB%8E%E9%9B%B6%E6%90%AD%E5%BB%BA%E6%88%91%E7%9A%84%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/</id>
    <link href="https://wjqblog.cn/2026/10/07/%E4%BB%8E%E9%9B%B6%E6%90%AD%E5%BB%BA%E6%88%91%E7%9A%84%E4%B8%AA%E4%BA%BA%E5%8D%9A%E5%AE%A2/"/>
    <published>2026-10-07T07:00:00.000Z</published>
    <summary>
      <![CDATA[<p>花了两天时间，我从零搭建了自己的个人博客 <a href="https://wjqblog.cn/">wjqblog.cn</a>。总成本 <strong>38 元</strong>（域名两年），其余全部免费。这篇文章记录从安装环境到正式上线的完整过程，给想搭博客的朋友一份能照着走的路线图。</p>]]>
    </summary>
    <title>从零搭建我的个人博客：Hexo + Cloudflare 全记录</title>
    <updated>2026-10-07T08:53:23.327Z</updated>
  </entry>
  <entry>
    <author>
      <name>吴锦渠</name>
    </author>
    <category term="生活" scheme="https://wjqblog.cn/categories/%E7%94%9F%E6%B4%BB/"/>
    <category term="随笔" scheme="https://wjqblog.cn/tags/%E9%9A%8F%E7%AC%94/"/>
    <content>
      <![CDATA[<p>欢迎来到我的技术博客。</p><p>这里会记录我的学习笔记、技术思考，以及一些踩坑与填坑的过程。</p><p>博客基于 Hexo 构建，部署在 EdgeOne 上，写作流程是：本地 Markdown → Git 推送 → 自动构建上线。</p><p>新博客刚开张，内容会一点点多起来，敬请期待。</p>]]>
    </content>
    <id>https://wjqblog.cn/2026/10/06/%E4%BD%A0%E5%A5%BD-%E6%88%91%E6%98%AF%E5%90%B4%E9%94%A6%E6%B8%A0/</id>
    <link href="https://wjqblog.cn/2026/10/06/%E4%BD%A0%E5%A5%BD-%E6%88%91%E6%98%AF%E5%90%B4%E9%94%A6%E6%B8%A0/"/>
    <published>2026-10-06T08:00:00.000Z</published>
    <summary>
      <![CDATA[<p>欢迎来到我的技术博客。</p>
<p>这里会记录我的学习笔记、技术思考，以及一些踩坑与填坑的过程。</p>
<p>博客基于 Hexo 构建，部署在 EdgeOne 上，写作流程是：本地 Markdown → Git 推送 → 自动构建上线。</p>
<p>新博客刚开张，内容]]>
    </summary>
    <title>你好，我是吴锦渠</title>
    <updated>2026-10-07T08:53:23.327Z</updated>
  </entry>
</feed>
