'function “jsonify” not defined' error while trying to Quick Start tutorial


#1

I’m using Ubuntu 16.04 and I installed Hugo using :

sudo apt-get install hugo

My hugo version :

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

I was trying to deploy hugo-theme-bleak as per the Quick start tutorial in Hugo website.

After cloning the theme using

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

I tried running hugo server using following command :

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

But I’m getting the following error , and the page is not generated properly.

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

The same sort of ‘function not defined’ error popping up with several other themes also, which I tried.

Any ideas on how to fix ?

I’ve asked the same on stackoverflow too.

Thanks for help!


#2

Likely because the version you are using is 17 months old. Don’t get hugo from the repo, get it directly from the git release page, it’s on version 0.25.1 now. jsonify I think is a later addition so your hugo version doesn’t know what to do with it.


#3

@gaetawoo Thanks a lot !!
I tried with version 0.25.1 and after fixing some variable configuration errors in toml file hugo-theme-bleak was working perfectly.

I think the installation from apt repo as in instructions should be tagged obsolete or updated. Most of the themes out there were giving the above error with the older version.

Cheers!!
Thankyou


#4

Below the Ubuntu instructions it list a con:

Might not be the latest version, especially if you are using an older stable version (e.g., Ubuntu 16.04 LTS). Until backports and PPA are available, you may consider installing the Hugo snap package to get the latest version of Hugo, as described below.

How can we make that more informative for future users?


#5

It’s all written well. Maybe I didn’t give it proper attention because I was restless. I’m Sorry.
Thanks for your time :slight_smile: .

Maybe you should tell people not to install using apt , because that version is too old, and nothing works well in that.


#6

Please add the text you think should be there. :slight_smile: