<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>首页 on DaoMind</title><link>https://daomind.dpdns.org/</link><description>Recent content in 首页 on DaoMind</description><generator>Hugo</generator><language>zh-CN</language><lastBuildDate>Mon, 16 Nov 2026 00:00:00 +0000</lastBuildDate><atom:link href="https://daomind.dpdns.org/index.xml" rel="self" type="application/rss+xml"/><item><title>上线前备忘录：静态站从零到 Cloudflare Pages</title><link>https://daomind.dpdns.org/posts/deploy-checklist/</link><pubDate>Mon, 16 Nov 2026 00:00:00 +0000</pubDate><guid>https://daomind.dpdns.org/posts/deploy-checklist/</guid><description>&lt;p>这套流程从零跑到 Cloudflare Pages，踩了不少坑。浓缩成清单，照着做就不会卡。&lt;/p>
&lt;blockquote>
&lt;p>为什么选静态站、砍掉了哪些后台能力，看 &lt;a href="https://daomind.dpdns.org/posts/why-static-nav/">为什么没用带后台的导航程序&lt;/a>；为什么最终没做热榜，看 &lt;a href="https://daomind.dpdns.org/posts/why-no-hotboard/">为什么放弃了热榜模块&lt;/a>。逐条决策的 A/B/C 对比与死因，见仓库内 &lt;code>docs/10-决策记录.md&lt;/code>（本站文档，非公开页面）。&lt;/p>&lt;/blockquote>
&lt;h2 id="阶段-0装-hugo">阶段 0：装 Hugo&lt;/h2>
&lt;ul>
&lt;li>包管理器（scoop/choco/winget）&lt;strong>全都没有&lt;/strong>，走 GitHub Releases 手动装&lt;/li>
&lt;li>装 &lt;strong>extended&lt;/strong> 版（将来 Sass 编译要用），不是标准版&lt;/li>
&lt;li>下载 21.5 MB 实测花了 &lt;strong>19 分钟&lt;/strong>，GitHub 有时极慢，要有耐心&lt;/li>
&lt;li>版本判定：v0.170.0 起 &lt;code>hugo version&lt;/code> &lt;strong>不再打印 &lt;code>+extended&lt;/code>&lt;/strong>。别误判。改用 &lt;code>hugo env&lt;/code> 看 &lt;code>libsass&lt;/code>/&lt;code>sass&lt;/code>，或直接看二进制里有没有 &lt;code>libsass&lt;/code> 字符串&lt;/li>
&lt;/ul>
&lt;h2 id="阶段-1配置真值">阶段 1：配置真值&lt;/h2>
&lt;p>&lt;code>hugo.toml&lt;/code> 三个关键值，&lt;strong>最后绑定的域名一定要写对&lt;/strong>：&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-toml" data-lang="toml">&lt;span class="line">&lt;span class="cl">&lt;span class="nx">baseURL&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="s2">&amp;#34;https://daomind.dpdns.org/&amp;#34;&lt;/span> &lt;span class="c"># 末尾 / 不能丢，影响 canonical/sitemap/RSS&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="nx">title&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="s2">&amp;#34;DaoMind&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="p">[&lt;/span>&lt;span class="nx">params&lt;/span>&lt;span class="p">]&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl"> &lt;span class="nx">author&lt;/span> &lt;span class="p">=&lt;/span> &lt;span class="s2">&amp;#34;DaoMind&amp;#34;&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="阶段-2本地双验证">阶段 2：本地双验证&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">hugo --gc --minify &lt;span class="c1"># 生产构建，检查 public/ 产物齐全&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">hugo server -D &lt;span class="c1"># 开发服务器，逐个路由确认 200&lt;/span>
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;ul>
&lt;li>检查 &lt;code>public/&lt;/code>：&lt;code>index.html&lt;/code>、&lt;code>sitemap.xml&lt;/code>、&lt;code>index.xml&lt;/code>、&lt;code>robots.txt&lt;/code>、&lt;code>404.html&lt;/code>&lt;/li>
&lt;li>检查 canonical 是否已是最终域名&lt;/li>
&lt;li>有 3 个弃用警告（&lt;code>languageCode&lt;/code>→&lt;code>locale&lt;/code>、&lt;code>.Site.LanguageCode&lt;/code>→&lt;code>.Site.Language.Locale&lt;/code>、&lt;code>.Site.Data&lt;/code>→&lt;code>hugo.Data&lt;/code>），&lt;strong>本次不修&lt;/strong>，等 Hugo 真删了再迁&lt;/li>
&lt;/ul>
&lt;h2 id="阶段-3首次提交">阶段 3：首次提交&lt;/h2>
&lt;ul>
&lt;li>仓库级配置身份（&lt;strong>不要动全局&lt;/strong>）：&lt;code>git config user.name&lt;/code>/&lt;code>user.email&lt;/code>&lt;/li>
&lt;li>&lt;code>.gitignore&lt;/code> 必须含 &lt;code>public/&lt;/code>、&lt;code>resources/&lt;/code>、&lt;code>.hugo_build.lock&lt;/code>——提交前用 &lt;code>git check-ignore&lt;/code> 确认生效&lt;/li>
&lt;li>提交后验证 &lt;code>git status&lt;/code> clean、&lt;code>public/&lt;/code> 不在跟踪列表&lt;/li>
&lt;/ul>
&lt;h2 id="阶段-4推送">阶段 4：推送&lt;/h2>
&lt;p>&lt;strong>SSH 大概率不通&lt;/strong>（实测：&lt;code>Permission denied (publickey)&lt;/code>，因为 ssh-agent 没跑 + key 名非默认）。&lt;strong>直接走 HTTPS&lt;/strong>：&lt;/p></description></item><item><title>为什么放弃了热榜模块</title><link>https://daomind.dpdns.org/posts/why-no-hotboard/</link><pubDate>Mon, 16 Nov 2026 00:00:00 +0000</pubDate><guid>https://daomind.dpdns.org/posts/why-no-hotboard/</guid><description>&lt;p>做导航页时，最吸引眼球的是很多导航站顶部那条「每日热榜」。评估了很久，最终决定&lt;strong>不接入&lt;/strong>。这篇把三条路径的实测证据记下来，免得以后又心痒。&lt;/p>
&lt;blockquote>
&lt;p>站点怎么从零部署到 Cloudflare Pages，见 &lt;a href="https://daomind.dpdns.org/posts/deploy-checklist/">上线前备忘录&lt;/a>。为什么本站不碰后台、数据库、在线编辑，见 &lt;a href="https://daomind.dpdns.org/posts/why-static-nav/">为什么没用带后台的导航程序&lt;/a>。&lt;/p>&lt;/blockquote>
&lt;h2 id="三条路径全部实测证伪">三条路径，全部实测证伪&lt;/h2>
&lt;h3 id="-接公开热榜-api">① 接公开热榜 API&lt;/h3>
&lt;p>找了 14 个候选数据源，结果全失败：DNS 失效、请求超时、返回 401/400、或者干脆返回一个 SPA 回退页。唯一一个允许跨域（&lt;code>Access-Control-Allow-Origin: *&lt;/code>）的，返回的也是 HTML 而非 JSON。&lt;/p>
&lt;h3 id="-抓页面上的-hotboard">② 抓页面上的 /hotboard&lt;/h3>
&lt;p>一些导航站是服务端渲染，但实测发现这类 &lt;code>/hotboard&lt;/code> 页面的原始 HTML 里 &lt;code>&amp;lt;a&amp;gt;&lt;/code> 标签数量为 0，内嵌数据为空——榜单不是服务端直出的，是靠&lt;strong>客户端 XHR 再拉一次&lt;/strong>。抓 HTML 拿不到数据。&lt;/p>
&lt;h3 id="-自建-dailyhotapi-后端">③ 自建 DailyHotApi 后端&lt;/h3>
&lt;p>这是技术上&lt;strong>唯一可行&lt;/strong>的路径：自己搭一个 API，前端定时拉取，再配 GitHub Actions 每天自动更新。但它违反了我们「&lt;strong>零服务器、零数据库、零依赖&lt;/strong>」的底线——为一条榜单养一个常驻服务，不值得。&lt;/p>
&lt;h2 id="结论">结论&lt;/h2>
&lt;p>&lt;strong>技术可行 ≠ 应该做。&lt;/strong> 三条路都试过了，最后选了第 4 条：&lt;strong>不接&lt;/strong>。&lt;/p>
&lt;ul>
&lt;li>热榜数据源依赖第三方，且没有一个稳定的；&lt;/li>
&lt;li>自建后端引入运维面，与静态站「Git 即全部资产」的定位冲突；&lt;/li>
&lt;li>热榜的实际引流权重也没有验证过，可能只是附属装饰。&lt;/li>
&lt;/ul>
&lt;p>所以本站只保留了「导航 + 博客」的主体，热榜空缺。如果哪天有免费、稳定、无需密钥的公开 API，再重新评估不迟。&lt;/p></description></item><item><title>把这个导航站跑起来了</title><link>https://daomind.dpdns.org/posts/hello-hugo/</link><pubDate>Mon, 16 Nov 2026 00:00:00 +0000</pubDate><guid>https://daomind.dpdns.org/posts/hello-hugo/</guid><description>&lt;p>终于把常用网站收在一个页面里了，顺手也给自己留了几篇能写字的地方。&lt;/p>
&lt;h2 id="为什么是静态的">为什么是静态的&lt;/h2>
&lt;p>导航站的本质是&lt;strong>一张只读的表&lt;/strong>：分类、分组、链接、图标、备注，全都是提前写好的内容，不需要每个人看到的不一样，也不需要点一下就存进数据库。这类东西交给 Hugo 在构建时印成 HTML，比养一台服务器划算得多。&lt;/p>
&lt;blockquote>
&lt;p>判断标准：要「每个人看到的不一样」或「点几下立刻写库」才需要服务端；只是「每个人看到同一张表」，静态生成永远更省。&lt;/p>&lt;/blockquote>
&lt;h2 id="这套东西包含什么">这套东西包含什么&lt;/h2>
&lt;ul>
&lt;li>顶栏搜索、亮暗主题、简洁 / 详细模式&lt;/li>
&lt;li>分类网格，鼠标移上去图标会跳一下，并浮出预写好的备注与网址&lt;/li>
&lt;li>顶部一排推广图，可以开轮播&lt;/li>
&lt;li>底部三篇最近文章，顶栏一个低调的「文章」入口&lt;/li>
&lt;/ul>
&lt;h2 id="发布流程">发布流程&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">hugo new posts/新文章.md &lt;span class="c1"># 记得把 draft 改成 false&lt;/span>
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">hugo server -D
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">git add . &lt;span class="o">&amp;amp;&amp;amp;&lt;/span> git commit -m &lt;span class="s2">&amp;#34;post: 标题&amp;#34;&lt;/span> &lt;span class="o">&amp;amp;&amp;amp;&lt;/span> git push
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>push 之后 Cloudflare Pages 自动构建，一两分钟生效。没有服务器、没有数据库、没有备份脚本——&lt;strong>Git 仓库就是全部资产&lt;/strong>。&lt;/p></description></item><item><title>为什么没用带后台的导航程序</title><link>https://daomind.dpdns.org/posts/why-static-nav/</link><pubDate>Tue, 10 Nov 2026 00:00:00 +0000</pubDate><guid>https://daomind.dpdns.org/posts/why-static-nav/</guid><description>&lt;p>看过几个做得很好的导航站，它们有后台、能拖拽排序、能在线加链接、还能登录同步个人收藏。做得确实漂亮，但把功能清单拆开看，我真正用得上的只有前两屏。&lt;/p>
&lt;h2 id="砍掉的部分">砍掉的部分&lt;/h2>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>能力&lt;/th>
 &lt;th>要不要&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>分类网格、图标、搜索、hover 浮层&lt;/td>
 &lt;td>要&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>亮暗主题、简洁模式、移动端&lt;/td>
 &lt;td>要&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>登录、个人收藏页、公开主页&lt;/td>
 &lt;td>不要&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>在线可视化编辑、右键批量整理&lt;/td>
 &lt;td>不要&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>服务端 API 代理、AI 搜索补全&lt;/td>
 &lt;td>不要&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;p>后面三行全部长在「登录 + 常驻服务端」这两根支柱上。抽掉之后，剩下的就是一张带交互的只读表格。&lt;/p>
&lt;h2 id="换来的东西">换来的东西&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>零服务器&lt;/strong>：不用管系统、证书续期、数据库、安全更新&lt;/li>
&lt;li>&lt;strong>零账单风险&lt;/strong>：Pages 免费版静态请求与带宽不限量，没有超额扣费这回事&lt;/li>
&lt;li>&lt;strong>零备份工作&lt;/strong>：文章、配置、导航数据全是纯文本，天然带版本历史&lt;/li>
&lt;li>&lt;strong>不怕机器被回收&lt;/strong>：免费 VPS 的闲置回收、无快照、封号，这些风险全部不存在&lt;/li>
&lt;/ul>
&lt;p>代价只有一条：&lt;strong>改一个链接要 &lt;code>git push&lt;/code>，等一两分钟构建生效&lt;/strong>，不是后台点保存秒出。对几天加一个网站的节奏，基本无感。&lt;/p>
&lt;p>一句话：这不是&amp;quot;低配版导航站&amp;quot;，是把不需要的那一半整个删掉。&lt;/p></description></item><item><title>Cloudflare Pages 上线备忘录</title><link>https://daomind.dpdns.org/posts/pages-notes/</link><pubDate>Mon, 02 Nov 2026 00:00:00 +0000</pubDate><guid>https://daomind.dpdns.org/posts/pages-notes/</guid><description>&lt;p>记一下这次上线踩过的点，免得下次重新搜。&lt;/p>
&lt;h2 id="构建设置">构建设置&lt;/h2>
&lt;table>
 &lt;thead>
 &lt;tr>
 &lt;th>项&lt;/th>
 &lt;th>值&lt;/th>
 &lt;/tr>
 &lt;/thead>
 &lt;tbody>
 &lt;tr>
 &lt;td>Build command&lt;/td>
 &lt;td>&lt;code>hugo --gc --minify&lt;/code>&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Build output directory&lt;/td>
 &lt;td>&lt;code>public&lt;/code>&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Root directory&lt;/td>
 &lt;td>留空&lt;/td>
 &lt;/tr>
 &lt;tr>
 &lt;td>Production branch&lt;/td>
 &lt;td>&lt;code>main&lt;/code>&lt;/td>
 &lt;/tr>
 &lt;/tbody>
&lt;/table>
&lt;p>环境变量里必须加 &lt;code>HUGO_VERSION&lt;/code>，值和本地 &lt;code>hugo version&lt;/code> 查到的一致。开了 PR 预览的话，&lt;strong>Preview 环境也要加同一个变量&lt;/strong>，否则预览部署会构建失败。&lt;/p>
&lt;h2 id="绑定域名的顺序">绑定域名的顺序&lt;/h2>
&lt;p>&lt;strong>先在 Pages 后台 Custom domains 关联域名，再去配 DNS。&lt;/strong> 反过来直接 CNAME 指向 &lt;code>xxx.pages.dev&lt;/code> 会报 522，证书也可能签不下来。&lt;/p>
&lt;ul>
&lt;li>根域名：必须把域名加为 Cloudflare zone 并改 NS，之后它自动创建 CNAME&lt;/li>
&lt;li>子域名：在原域名商加一条 CNAME 即可&lt;/li>
&lt;li>域名原先有 CAA 记录的，要放行 &lt;code>letsencrypt.org&lt;/code>、&lt;code>pki.goog&lt;/code>、&lt;code>digicert.com&lt;/code>、&lt;code>comodoca.com&lt;/code>&lt;/li>
&lt;/ul>
&lt;h2 id="其他">其他&lt;/h2>
&lt;p>&lt;code>static/_headers&lt;/code> 可以配响应头，&lt;code>enableRobotsTXT = true&lt;/code> 会自动生成 robots.txt 并带上 sitemap 地址。图标走目标站 &lt;code>/favicon.ico&lt;/code>，加载失败会回退成名称首字，所以别人换图标顶多裂一张，不影响整站。&lt;/p>
&lt;p>国内访问没有大陆节点，这是免费版的硬边界，绑自定义域名能改善一部分，但别指望和国内 CDN 一样快。&lt;/p></description></item><item><title>关于</title><link>https://daomind.dpdns.org/about/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://daomind.dpdns.org/about/</guid><description>&lt;p>这是一个&lt;strong>自己用的导航页&lt;/strong>，顺手放几篇折腾记录。&lt;/p>
&lt;h2 id="这个站是什么">这个站是什么&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>导航数据&lt;/strong>：&lt;code>data/links.yaml&lt;/code>（分类、分组、链接、备注全是提前写好的纯文本）&lt;/li>
&lt;li>&lt;strong>推广位&lt;/strong>：&lt;code>data/promos.yaml&lt;/code>&lt;/li>
&lt;li>&lt;strong>文章&lt;/strong>：&lt;code>content/posts/&lt;/code>&lt;/li>
&lt;li>&lt;strong>生成&lt;/strong>：Hugo（静态站生成器）&lt;/li>
&lt;li>&lt;strong>托管&lt;/strong>：Cloudflare Pages&lt;/li>
&lt;/ul>
&lt;h2 id="为什么是静态的">为什么是静态的&lt;/h2>
&lt;p>导航站的本质是&lt;strong>一张只读的表&lt;/strong>：内容不需要「每个人看到的不一样」，也不需要「点一下就存进数据库」。这类东西交给 Hugo 在构建时印成 HTML，比养一台服务器划算得多。&lt;/p>
&lt;ul>
&lt;li>&lt;strong>零服务器&lt;/strong>：不用管系统、证书续期、数据库、安全更新&lt;/li>
&lt;li>&lt;strong>零账单风险&lt;/strong>：Pages 免费版静态请求与带宽不限量，没有超额扣费&lt;/li>
&lt;li>&lt;strong>零备份工作&lt;/strong>：文章、配置、导航数据全是纯文本，天然带版本历史&lt;/li>
&lt;li>&lt;strong>不怕机器被回收&lt;/strong>：免费 VPS 的闲置回收、无快照、封号，这些风险全部不存在&lt;/li>
&lt;/ul>
&lt;p>代价只有一条：改一个链接要 &lt;code>git push&lt;/code>，等一两分钟构建生效，不是后台点保存秒出。对几天加一个网站的节奏，基本无感。&lt;/p>
&lt;h2 id="没有的东西">没有的东西&lt;/h2>
&lt;ul>
&lt;li>没有登录、没有后台、没有数据库&lt;/li>
&lt;li>没有个人收藏页、没有在线可视化编辑&lt;/li>
&lt;li>没有服务端 API 代理、没有 AI 搜索补全&lt;/li>
&lt;/ul>
&lt;p>后面这些全部长在「登录 + 常驻服务端」这两根支柱上。抽掉之后，剩下的就是一张带交互的只读表格。&lt;/p>
&lt;h2 id="联系方式">联系方式&lt;/h2>
&lt;p>有问题或想交换友链，可以在文章里找到联系方式，或直接发邮件到 &lt;code>782238788@qq.com&lt;/code>。&lt;/p>
&lt;h2 id="订阅">订阅&lt;/h2>
&lt;p>本站每篇文章都有一个&lt;strong>地址&lt;/strong>（&lt;code>/index.xml&lt;/code>）。这是标准的 RSS 订阅源，任何 RSS 阅读器都能用。&lt;/p>
&lt;p>想用手机或浏览器订阅的话，把 &lt;code>https://daomind.dpdns.org/index.xml&lt;/code> 粘贴进你的阅读器即可。没有「登录、注册、推送」这些环节——它就是一份纯文本清单，读到了就是读到了。&lt;/p></description></item></channel></rss>