victoriadrake / hugo-theme-introduction

Minimal, single page, smooth-scrolling theme for Hugo static site generator.
https://hugo-introduction.netlify.com/
Apache License 2.0
668 stars 265 forks source link

Page interface changes in hugo master break the theme #141

Closed davidski closed 5 years ago

davidski commented 5 years ago

This (https://github.com/gohugoio/hugo/commit/597e418cb02883418f2cebb41400e8e61413f651) recent big landing on hugo master seems to break this theme. This means anyone using go get to install hugo will not be able to use this theme. I'm not familiar enough with hugo to fully debug this, but this looks related to the taxonomy changes. Opening this up for more knowledgeable eyes than mine to take a look.

Sample errors include: ERROR 2019/03/24 14:46:41 render of "taxonomyTerm" failed: execute of template failed: template: _default/terms.html:24:19: executing "_default/terms.html" at <partial "nav.html" .>: error calling partial: "/home/travis/gopath/src/github.com/davidski/tidyrisk/themes/introduction/layouts/partials/nav.html:5:27": execute of template failed: template: partials/nav.html:5:27: executing "partials/nav.html" at <.Page.IsHome>: can't evaluate field Page in type *hugolib.pageState

My source deployment is at https://github.com/davidski/tidyrisk.

Thanks for all the work on this nifty theme!

hanzei commented 5 years ago

Hey @davidski,

Thanks for the report and heads up. I will look into this issue after the next release of Hugo has been published. Who knows what kind of other breaking changes will come up?

Site note: Is there a particular reason you install Hugo via go get instead of fetching the binary? You can also use go get github.com/gohugoio/hugo@v0.54.0 if you are using Go Modules.

hanzei commented 5 years ago

See also https://github.com/gohugoio/hugo/issues/5784

onedrawingperday commented 5 years ago

@hanzei

The problem is in /layouts/partials/nav.html

Basically you need to change .Page.IsHome to .IsHome and every other instance of .Page e.g. .Page.Section since now Page has become an interface.

However also keep track of https://github.com/gohugoio/hugo/issues/5784 in case something changes.

davidski commented 5 years ago

Thanks for the quick investigation!

Pinning a particular version of hugo would definitely be a much better idea. I'm running this particular build on Travis CI, where I've been spectacularly unsuccessful in getting a defined version of hugo up and running. The linux x64 builds surprisingly seem to require some additional C++ compilers to run, which was a bit too exhausting to track down this weekend.

I'll give the go get syntax you suggest another try. I'm pretty sure I tried that with some issue, but will hack at that some more.

hanzei commented 5 years ago

I'm running this particular build on Travis CI, where I've been spectacularly unsuccessful in getting a defined version of hugo up and running.

Take a look at https://github.com/victoriadotdev/hugo-theme-introduction/blob/master/.travis.yml#L13-L16

davidski commented 5 years ago

Appreciate the tip! Unfortunately, that still errors out for me due to the versions of glibc available. This may be because I'm running hugo extended for full resource regeneration...

https://travis-ci.org/davidski/tidyrisk/builds/510726068 shows the errors I get, if you're curious. :smile:

hanzei commented 5 years ago

We are getting off-topic quite fast, but still:

I strongly think you should check in your resources directory and get rid of the extended version for CI. There is just no need for it.

onedrawingperday commented 5 years ago

@hanzei Feel free to close this issue. You don't really need to worry about this anymore as it was fixed.

Note that several variables became deprecated and these will now throw warnings that you will need to address once Hugo 0.55 is out.

hanzei commented 5 years ago

Thanks for the heads up @onedrawingperday.

And as always: Thank you very much for the work you do for Hugo and the community! It's awesome! :tada: