<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>脚本与工具教程 on Shura 极客技术笔记</title><link>https://techblog.shashura1.top/categories/%E8%84%9A%E6%9C%AC%E4%B8%8E%E5%B7%A5%E5%85%B7%E6%95%99%E7%A8%8B/</link><description>Recent content in 脚本与工具教程 on Shura 极客技术笔记</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Sat, 18 Jul 2026 00:00:00 +0800</lastBuildDate><atom:link href="https://techblog.shashura1.top/categories/%E8%84%9A%E6%9C%AC%E4%B8%8E%E5%B7%A5%E5%85%B7%E6%95%99%E7%A8%8B/index.xml" rel="self" type="application/rss+xml"/><item><title>Hugo 静态博客免费加装评论区与浏览量统计｜Twikoo、Cloudflare Workers、D1 全套实录（附避坑指南）</title><link>https://techblog.shashura1.top/posts/hugo-blog-twikoo-comments-pageview-tutorial/</link><pubDate>Sat, 18 Jul 2026 00:00:00 +0800</pubDate><guid>https://techblog.shashura1.top/posts/hugo-blog-twikoo-comments-pageview-tutorial/</guid><description>&lt;h2 id="前言">前言&lt;/h2>
&lt;p>静态博客天生有两个&amp;quot;残疾&amp;quot;：没有评论区，没有浏览量。页面是纯 HTML，没有后端，读者看完想说句话都没地方留。&lt;/p>
&lt;p>网上教程大多让你用 LeanCloud + Vercel 部署 Waline，我原本也打算这么干，结果一路撞墙：&lt;/p>
&lt;ol>
&lt;li>LeanCloud 国际版已经&lt;strong>关闭新用户注册&lt;/strong>，老教程全部作废&lt;/li>
&lt;li>Vercel 新账号动不动卡在&amp;quot;requires further verification&amp;quot;，GitHub 登录也过不去&lt;/li>
&lt;li>Waline 官方&lt;strong>根本不支持 Cloudflare Workers&lt;/strong>，此路彻底不通&lt;/li>
&lt;/ol>
&lt;p>最后换 &lt;strong>Twikoo&lt;/strong>，整套方案全部跑在 Cloudflare 上：评论后端是 CF Workers，数据存 CF D1 数据库，浏览量统计是自己写的 30 行 Worker，复用同一个数据库。&lt;strong>月成本 0 元，数据全在自己账号里&lt;/strong>，不依赖任何第三方评论平台。&lt;/p>
&lt;p>本文是完整实操记录，所有命令可直接照搬。我的博客本体搭建过程见上一篇《从零搭建 Hugo 静态博客》，本文假设你已经有一个跑在 Cloudflare Pages 上的 Hugo 博客。&lt;/p>
&lt;h2 id="一选型为什么是-twikoo">一、选型：为什么是 Twikoo&lt;/h2>
&lt;p>先回答最多人关心的问题：&lt;strong>读者评论要不要注册账号？&lt;/strong>&lt;/p>
&lt;table>
&lt;thead>
&lt;tr>
&lt;th>评论系统&lt;/th>
&lt;th>读者要账号吗&lt;/th>
&lt;th>后端部署&lt;/th>
&lt;th>坑&lt;/th>
&lt;/tr>
&lt;/thead>
&lt;tbody>
&lt;tr>
&lt;td>giscus / utterances&lt;/td>
&lt;td>要 GitHub 账号&lt;/td>
&lt;td>免部署&lt;/td>
&lt;td>国内读者大多没有 GitHub&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Disqus&lt;/td>
&lt;td>要 Disqus 账号&lt;/td>
&lt;td>免部署&lt;/td>
&lt;td>国内直接打不开&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>Waline&lt;/td>
&lt;td>不要，匿名可评&lt;/td>
&lt;td>Vercel 等&lt;/td>
&lt;td>LeanCloud 停注册、不支持 CF&lt;/td>
&lt;/tr>
&lt;tr>
&lt;td>&lt;strong>Twikoo&lt;/strong>&lt;/td>
&lt;td>&lt;strong>不要，昵称即可&lt;/strong>&lt;/td>
&lt;td>&lt;strong>CF Workers 官方支持&lt;/strong>&lt;/td>
&lt;td>基本没坑&lt;/td>
&lt;/tr>
&lt;/tbody>
&lt;/table>
&lt;p>Twikoo 是国产开源项目，中文界面，读者&lt;strong>填个昵称就能评论&lt;/strong>（邮箱选填且不公开），带管理面板、评论审核、邮件通知。官方提供 &lt;code>twikoo-cloudflare&lt;/code> 仓库，直接部署到 Cloudflare Workers，数据存 D1（Cloudflare 的免费 SQLite 数据库，每天 500 万次读取额度，个人博客用不完）。&lt;/p></description></item></channel></rss>