type
status
date
slug
summary
tags
category
icon
password
😀
  • Vercel 部署 Hugo:一站式解决所有问题
  • 新手必看:Vercel 部署 Hugo 的完整指南
 
我最近在创建一个 sora video 收集网站,使用 hugo 来开发,同时部署到 Vercel 上。在部署时遇到一些问题,以下是一个简单的记录。

Install Hugo

 
你可以查看 Hugo 官网 来安装 hugo。在 mac 上,我使用 brew 安装。

Build in Local

我使用的是 https://gethinode.com/ ,A clean documentation and blog theme for your Hugo site based on Bootstrap 5.
1. Create a new site
2. Initialize the module system
3. Start a development server

Deploy with Vercel

 
代码推到 github 后,使用 vercel 关联 repo 部署 site,部署成功后打开总是一个 xml 页面。
notion image
查看部署日志,提示
 
notion image
我使用官方模板可以正常部署成功也可以访问,开始我以为是模板的问题,找到模板的作者寻求帮助。 https://github.com/gethinode/hinode/discussions/789
 
但是作者也没有遇到过这个问题。
然后我把 Vercel 官方的模板在本地运行,希望能对比差异,发现运行报错。我突然意识到可能是 hugo 版本的问题。
经过搜索,发现在 Vercel 部署是可以设置 hugo 版本的。
 
notion image
修改版本之后果然开始真正部署。如果提示
 
 
可以在 Install Command 添加上以下命令来安装 golang。
 
notion image
到这里就部署成功了。
 
notion image
 
🎉🎉🎉🎉🎉🎉

📎 参考文章

 
鱼香肉丝Bilibili gengine 简易使用指南
Gusibi
Gusibi
后端开发,擅长使用 Python 和 Golang,现在面向AI编程。热爱探索新互联网产品,曾写过小程序。正在学习 Flutter,热衷于技术的探索与进步。
公告
type
status
date
slug
summary
tags
category
icon
password
🎉欢迎访问🎉
-- 感谢您的支持 ---
👏欢迎更新体验👏
 
🤺
关于我