【问题标题】:'function "jsonify" not defined' error while trying to deploy in hugo尝试在 hugo 中部署时出现“未定义函数“jsonify”错误
【发布时间】:2017-07-24 02:43:02
【问题描述】:

我使用的是 Ubuntu 16.04,我使用以下方式安装了 Hugo:

sudo apt-get install 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

同样的“函数未定义”错误与其他几个主题一起弹出,我试过了。

关于如何解决的任何想法?

感谢您的帮助!

【问题讨论】:

    标签: hugo


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2021-06-04
      • 2023-02-07
      • 1970-01-01
      • 2019-11-09
      • 2017-10-04
      • 2022-01-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多