New user - many themes failing

So I thought I’d try this - a couple of hours later, I’m confused as to how to find out themes that are working and those that are not working/abandoned?

Get many errors when running hugo, most themes error out, and error messages are very confusing (to this new user).

Downloaded
hugo version
Hugo Static Site Generator v0.20.2 linux/amd64 BuildDate: 2017-04-16T05:18:49-06:00

www/hugo1/themes]# git clone https://github.com/syui/hugo-theme-wave.git Cloning into ‘hugo-theme-wave’.

hugo new home/new.md
…/www/hugo1/content/home/new.md created

Edited that file, removed “draft =…” line from there.

Then tried to use the theme:

hugo -t hugo-theme-wave
Started building sites …
ERROR 2017/04/16 11:39:15 Error while rendering “page”: template: theme/_default/single.html:6:7: executing “theme/_default/single.html” at <partial "single_arti…>: error calling partial: template: theme/partials/single_article.html:8:15: executing “theme/partials/single_article.html” at <partial "article_hea…>: error calling partial: template: theme/partials/article_header.html:6:76: executing “theme/partials/article_header.html” at <.Site.Params.date_fo…>: invalid value; expected string

Most themes I tried had somewhat similar errors.

Then this one seemed to work:
git clone https://github.com/kakawait/hugo-tranquilpeak-theme.git
Cloning into ‘hugo-tranquilpeak-theme’…

hugo -t hugo-tranquilpeak-theme
Started building sites …
Built site for language en:
0 draft content
0 future content
0 expired content
1 regular pages created
8 other pages created
0 non-page files copied
0 paginator pages created
0 tags created
0 categories created

That seems to work… the page is rendered badly due to wrong css/js links…, but that I can look around and try to fix.

Is it normal for many themes to fail?
Another one failing:
hugo -t hugo-minimalist-theme
Started building sites …
ERROR 2017/04/16 11:45:30 Error while rendering “page”: template: theme/_default/single.html:1:3: executing “theme/_default/single.html” at <partial “header” .>: error calling partial: template: theme/partials/header.html:24:60: executing “theme/partials/header.html” at : wrong number of args for absURL: want 1 got 0

We build (most) of the themes with a demo site at http://themes.gohugo.io/ regularly and with the newest Hugo version. So almost all of the themes are up to date and working.

But, that said, some of them have non-standard configurations they depend on (one of your examples expects a date format string in your site config etc.), and we will improve the experience here, but they’re not broken or “failing”, they just need some configuration to get up to speed.

I suggest you read the documentation of the failing theme(s) and try to adjust your settings. If you are really adventurous, you may get some hint by follow the script that builds the themes for the theme site:

Thanks, looks like this is a bit too much work - I was trying to move from Wordpress to something else, but probably nothing is as easy as WP yet…

One specific thing would have been nice: more useful error messages.
For example, it mentions
theme/_default/single.html
and there is no such file!

It takes some digging to figure out it probably meant
/themes//layouts/_default/single.html
(or maybe, it was not themes, but shadowed by some other folder? Actual file name would have helped immensely).

And a number of other errors: such as I was confused why it was not rendering some files at all. -v did not help in figuring out whether it even saw that file in content/
Turns out having a
layout = “post”
(or layout: post)
was probably causing that .md file to be skipped. Again, better errors here would have saved me from trying to uncomment lines to see what was going on.
(Maybe missing template file for layout? Have to speculate, or dig too much into code.)

And other error messages with that mentioned a line, and character position.
Maybe such error messages should print the entire suspect line itself with with full file pathname, so it is easier to see the problem?

In any case, thanks for your help and tips.

@bwooster I had the same experience, and spent a few hours testing nearly all the themes in the showcase and not gaining traction with any. Part of the reason is that I wanted to try a bunch, but make one of them work meant undoing those changes when I wanted to try a different theme.

Anyhow, I plan to make a very, very basic blog theme that will work out of the box just by declaring it in one’s config. :slight_smile:

Yea, well, we may have something to learn from WordPress in an area or two. I used WP before, and I don’t remember that I did a lot of theme-shifting, and once I found something that I liked I remember I spent a fair amount of time tweaking it to my liking, and even then it was on the slow side of the fence. So yes, we have some areas to improve in, but nothing really great comes without some work.

1 Like

I am hoping I can assist with that, because I make my living from WordPress, but even the stuff I do with it is kinda weird to most WP users (apps talking to apps and creating books and big enterprise sites). I’ve thought about theming a bit more than is probably healthy, so trying to learn more about Hugo I am throwing myself into making a solid, no frills theme.

There are three main reasons for it:

  1. I can’t grok the template hierarchy without referencing the docs, which I really need to understand thoroughly to setup the site I want.
  2. I’d like there to be a simple theme that folks can spin up their site and know it will work, so they can do things like debug their templates without configuring a new theme.
  3. Having lurked for about year, I have some thoughts on how folks should standardize their themes, but I am still tipping my toe in the zeitgeist to see how DIY themes will remain prior to 1.0.

I hope to ask a lot of questions and turn them into something to onboard new folks. :slight_smile:

1 Like