GDGToulouse / devfest-theme-hugo

A theme for a conference website. Created for DevFest Toulouse 2019
MIT License
88 stars 67 forks source link

`{{ .URL }}` causing issues #27

Closed salastro closed 2 years ago

salastro commented 2 years ago

Hello,

Running hugo v0.94.2+extended gives the following error:

ERROR 2022/04/14 21:13:11 Failed to render pages: render of "page" failed: "/home/salahdin/.srcpkgs/site-devfest-2019/themes/devfest-theme-hugo/layouts/_default/baseof.html:5:38": execute of template failed: template: _default/single.html:5:38: executing "_default/single.html" at <.URL>: can't evaluate field URL in type *hugolib.pageState

I tried removing the {{ anchorize .URL }} from the page, but this only moved the problem to other pages containing the same piece of code (speakers, partners, etc). It is possible to avoid this for pages other than baseof.html using {{ .Params.key }} since they all contain it while functioning the same as {{ .URL }}. However, I was not able to find any method to fix this issue for baseof.html; unfortunately, this snippet does affect the look of the website on certain sections. Thus, cannot be ignored.

Thanks for the time.

salastro commented 2 years ago

After exploring https://gohugo.io/variables/ a little, .File.ContentBaseName may fix the issue.