<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>建站 on 想记录少女的心事…</title><link>https://blog.20033999.xyz/tags/%E5%BB%BA%E7%AB%99/</link><description>Recent content from 想记录少女的心事…</description><generator>Hugo</generator><language>zh-cn</language><managingEditor>yursamor@users.noreply.github.com (yursamor)</managingEditor><webMaster>yursamor@users.noreply.github.com (yursamor)</webMaster><copyright>本博客所有文章除特别声明外，均采用 BY-NC-SA 许可协议。转载请注明出处！</copyright><lastBuildDate>Mon, 29 Jun 2026 17:30:23 +0800</lastBuildDate><atom:link href="https://blog.20033999.xyz/tags/%E5%BB%BA%E7%AB%99/index.xml" rel="self" type="application/rss+xml"/><item><title>我用 Hugo + reimu + Cloudflare Pages 搭了这个博客</title><link>https://blog.20033999.xyz/post/hello-world-1/</link><pubDate>Wed, 24 Jun 2026 23:30:00 +0800</pubDate><author>yursamor@users.noreply.github.com (yursamor)</author><guid>https://blog.20033999.xyz/post/hello-world-1/</guid><description>
<![CDATA[<h1>我用 Hugo + reimu + Cloudflare Pages 搭了这个博客</h1><p>作者：yursamor（yursamor@users.noreply.github.com）</p>
        
          <p>这是这个博客的第一篇文章。</p>
<p>本来想搞一个隆重的开场白，写点什么&quot;为什么要写博客&quot;或者&quot;未来想记录什么&quot;之类的宣言。但想了想——博客这东西，先有内容比先有理念重要。所以第一篇不立 flag，先把建站这件事记录下来，至少证明它<strong>真的能跑</strong>。</p>
<h2 id="选型">
<a class="header-anchor" href="#%e9%80%89%e5%9e%8b"></a>
选型
</h2><p>需求很简单：</p>
<ul>
<li><strong>静态博客</strong>（不想维护后端，不想操心数据库）</li>
<li><strong>主题好看</strong>（个人博客总要有点审美）</li>
<li><strong>部署省心</strong>（git push 一下就能上线最好）</li>
<li><strong>自定义域</strong>（不想用 <code>xxx.github.io</code> 这种后缀）</li>
</ul>
<p>最后选的是：</p>
<ul>
<li><strong>Hugo</strong> —— Go 写的静态站点生成器，速度快，构建就是几秒的事</li>
<li><strong>reimu 主题</strong> —— <code>D-Sketon/hugo-theme-reimu</code>，东方 Project 风格，看板娘、樱花飘落那些我都不开，但整体审美很对我胃口</li>
<li><strong>Cloudflare Pages</strong> —— 接 GitHub 仓库，push 即部署，全球 CDN + 自动 HTTPS</li>
<li><strong>域名</strong> <code>20033999.xyz</code> 下的子域 <code>blog.20033999.xyz</code></li>
</ul>
<h2 id="过程">
<a class="header-anchor" href="#%e8%bf%87%e7%a8%8b"></a>
过程
</h2><h3 id="1-本地装-hugo">
<a class="header-anchor" href="#1-%e6%9c%ac%e5%9c%b0%e8%a3%85-hugo"></a>
1. 本地装 Hugo
</h3><p>Ubuntu 20.04，本机 <code>hugo</code> 不存在。<code>apt</code> 装的是个老古董，主题要求的版本又太新。<strong>直接去 GitHub release 抓 tarball</strong>：</p>
<div class="highlight"><div class="chroma">
<table class="lntable"><tr><td class="lntd">
<pre tabindex="0" class="chroma"><code><span class="lnt">1
</span><span class="lnt">2
</span><span class="lnt">3
</span></code></pre></td>
<td class="lntd">
<pre tabindex="0" class="chroma"><code class="language-bash" data-lang="bash"><span class="line"><span class="cl">curl -L -o hugo.tar.gz https://github.com/gohugoio/hugo/releases/download/v0.124.1/hugo_extended_0.124.1_linux-amd64.tar.gz
</span></span><span class="line"><span class="cl">tar -xzf hugo.tar.gz hugo
</span></span><span class="line"><span class="cl">sudo mv hugo /usr/local/bin/
</span></span></code></pre></td></tr></table>
</div>
</div><p>版本是 v0.124.1，是当时能找到的最后一个能在我机器 <code>glibc 2.31</code> 上跑起来的 extended 版。<code>hugo_extended</code> 比普通版多了 SCSS 编译能力，主题要用到。</p>
        
        <hr><p>本文2026-06-24首发于<a href='https://blog.20033999.xyz/'>想记录少女的心事…</a>，最后修改于2026-06-29</p>]]></description><category>随笔</category></item></channel></rss>