jakewies / hugo-theme-codex

A minimal blog theme for Hugo 🍜
https://themes.gohugo.io/themes/hugo-theme-codex/
MIT License
334 stars 187 forks source link

Add FirstSuffix to MediaType for Hugo v0.82 and bump minimum version of Hugo to 0.82 #176

Closed mj-watts closed 3 years ago

mj-watts commented 3 years ago

As per #166 but with bumped minimum version added as that PR is old but I think this should to be added ASAP as breaking on new Hugo installs.

Problem

On a default install of the theme into a new vanilla Hugo site the build fails with errors:

ERROR 2021/07/20 10:19:05 render of "taxonomy" failed: "/home/test/themes/hugo-theme-codex/layouts/_default/baseof.html:39:97": execute of template failed: template: _default/list.html:39:97: executing "_default/list.html" at <.MediaType.Suffix>: can't evaluate field Suffix in type media.Type
ERROR 2021/07/20 10:19:05 render of "taxonomy" failed: "/home/test/themes/hugo-theme-codex/layouts/_default/baseof.html:39:97": execute of template failed: template: _default/list.html:39:97: executing "_default/list.html" at <.MediaType.Suffix>: can't evaluate field Suffix in type media.Type
Error: Error building site: failed to render pages: render of "home" failed: "/home/test/themes/hugo-theme-codex/layouts/_default/baseof.html:39:97": execute of template failed: template: index.html:39:97: executing "index.html" at <.MediaType.Suffix>: can't evaluate field Suffix in type media.Type

What's been done

The Hugo 0.82 release moved MediaType.Suffix to be MediaType.FirstSuffix.Suffix. This PR adds FirstSuffix in hugo-theme-codex/layouts/_default/baseof.html

And also bump min version of Hugo to 0.82 as adding FirstSuffix probably breaks builds on older versions of Hugo but at least they'll get a compatibility warning on build: Module "hugo-theme-codex" is not compatible with this Hugo version.

jakewies commented 3 years ago

Thanks @altescape I think we can safely merge this in along with the min_version update. I appreciate the initiative on this one!

jakewies commented 3 years ago

@all-contributors please add @altescape for code

allcontributors[bot] commented 3 years ago

@jakewies

I've put up a pull request to add @altescape! :tada: