Hugo:网页渲染缺失(只显示文字与超链接)

具体现象

使用hugo server在本地构建的网页显示正常,可是如果使用hugo -t 'theme_name'部署到public文件下渲染的话就会造成缺失,网页只显示文字与超链接

解决

hugourl解析是用的config.toml文件里面的baseURL,自己下载的主题的baseURL的值一般都是localhost,所以用hugo server完全没问题。要想渲染到public也正确的话只需将baseURL注释掉就好了

参考:Files in public folder not rendering correctly. But running locally by "hugo serve" is fine.

原文地址:https://www.cnblogs.com/Jaywhen-xiang/p/12730595.html