okfde / codefor.de

The website at codefor.de
https://codefor.de
MIT License
25 stars 36 forks source link

Resolve hugo warning about zero object #422

Closed k-nut closed 1 year ago

k-nut commented 1 year ago

This resolves the warning

.File.BaseFileName on zero object. Wrap it in if or with: {{ with .File }}{{ .BaseFileName }}{{ end }}

By replacing the check for the .Page.File.BaseFileName with an explicit new prop in the frontmatter which can be added when a page needs to load CSS.

It still is a bit implicit with the city param but I think this is better than before and it resolves the warning.