创建 Github 仓库 1 2 3 git remote add origin https://github.com/yourgithubusername/githubrepo git branch -M main git push -u origin main 使用 Cloudflare Pages 部署 登录 Cloudflare dashboard > Account Home > Pages,选择 Create a project,选择之前创建的 Github repo, 在 Setup Builds and deployments 选项中,设置以下信息: Configuration option Value Production branch main Build command hugo Build directory public 设置完后,点击 Save and Deploy。Cloudflare Pages 会开始安装依赖,构建网站,并部署。 设置 Hugo 版本 Build 过程中可能会报一些奇怪的错,比如 1 function “warnf” not defined 说明 Cloudflare Pages 上默认的版本可能较低。可在 Pages Project > Settings > Environment variables 中创建 HUGO_VERSION 环境变量。...