Only pages backed by a content file have a .File
.
Before I added this warning, the File
interface was embeded on Page
making a monstrous big API that was only relevant for some (most, I guess, but …).
So, this was a way of cleaning up the API: If you have/need a file, do {{ .File.Filename }}
(but it also warns about what’s probably a logical bug in your template: It does not make sense to apply file logic when it’s no file there …
Your problem is that you have templates that apply to both “content backed” pages and those that are not.
I don’t understand your template well enough to say for sure, but you should be able to use .Path
instead of .File.Path
.