尝试在hugo中部署时,'function'jsonify“未定义”错误

时间:2017-07-15 16:54:24

标签: hugo

我正在使用Ubuntu 16.04并使用以下方式安装Hugo:

sudo apt-get install hugo

我的hugo版本:

Hugo Static Site Generator v0.16-DEV BuildDate: 2016-02-06T12:14:17-05:00

我试图根据Hugo网站上的Quick start tutorial部署hugo-theme-bleak。

使用

克隆主题后

git clone https://github.com/Zenithar/hugo-theme-bleak.git

我尝试使用以下命令运行hugo服务器:

hugo server --theme=hugo-theme-bleak --buildDrafts

但是我收到以下错误,并且页面生成不正确。

ERROR: 2017/07/15 12:40:28 server.go:121: port 1313 already in use, 
attempting to use an available port

ERROR: 2017/07/15 12:40:28 template.go:350: template: theme/partials
/header.html:112: function "jsonify" not defined

ERROR: 2017/07/15 12:40:28 template.go:350: template: theme/partials
/pagination.html:4: function "slice" not defined

ERROR: 2017/07/15 12:40:28 template.go:119: html/template: 
"theme/partials/header.html" is an incomplete template in theme/partials
/header.html

ERROR: 2017/07/15 12:40:28 template.go:119: html/template: 
"theme/partials/pagination.html" is an incomplete template in 
theme/partials/pagination.html

ERROR: 2017/07/15 12:40:28 template.go:119: html/template: 
"theme/partials/header.html" is an incomplete template in theme/partials
/header.html

ERROR: 2017/07/15 12:40:28 template.go:119: html/template: 
"theme/partials/header.html" is an incomplete template in theme/partials
/header.html

ERROR: 2017/07/15 12:40:28 template.go:119: html/template: 
"theme/partials/pagination.html" is an incomplete template in 
theme/partials/pagination.html

1 of 1 draft rendered
0 future content
1 pages created
0 non-page files copied
2 paginator pages created
0 categories created
0 tags created
in 15 ms

同样的“功能未定义”错误也出现了几个其他主题,我试过。

关于如何修复的任何想法?

感谢您的帮助!

1 个答案:

答案 0 :(得分:0)

我得到了答案。 错误是因为Hugo的安装版本太旧了。 apt存储库中有非常旧版本的hugo。 建议下载' .deb'直接从hugo的git发布页面获取ubuntu系统的软件包。