从零到上线:我的第一篇 Hugo 博客发布实录(含国内网络避坑指南) 2025年12月9日 · 阅读约 5 分钟 标签:#Hugo #GitHub Pages #静态博客 #技术笔记 最近我决定搭建一个属于自己的技术博客,选择了轻量、快速、开源的 Hugo 静态网站生成器,并托管在 GitHub Pages 上。整个过程看似简单,却踩了不少“中国特色”的坑——尤其是网络连接问题。今天,我就把从写文章到成功上线的完整流程记录下来,希望能帮后来者少走弯路。 🧩 第一步:创建新文章 Hugo 提供了便捷的命令来生成新文章: powershell 编辑 hugo new posts/我的新文章.md 这会在 content/posts/ 目录下创建一个 Markdown 文件,内容类似: md 编辑 +++ title = “我的新文章” date = 2025-12-09T18:00:00+08:00 draft = true +++ 在这里写下你的思考…… ⚠️ 关键提醒:默认 draft = true 表示这是草稿,不会在线上显示! 要让文章公开,必须将其改为 draft = false,或直接删除这一行。 🔍 第二步:本地预览验证 在推送前,务必本地预览: powershell 编辑 hugo server -D 访问 http://localhost:1313,确认: 文章出现在首页 内容、图片、格式正常 无构建错误(如模板缺失、Front Matter 语法错误) -D 参数表示包含草稿,方便调试。 ...
我的新文章
这是我自己发布的第一篇文章,Hugo真的好难用,文章很难发布成功,
Hello
NOTE: This markdown cheatsheet is a typography demo for this theme. Check out this post to learn more about this markdown usage when you want to get started with this theme. Enjoy! Typography Elements in One Let’s start with a informative paragraph. This text is bolded. But not this one! How about italic text? Cool right? Ok, let’s combine them together. Yeah, that’s right! I have code to highlight, so ThisIsMyCode(). What a nice! Good people will hyperlink away, so here we go or http://www.example.com. ...