Hello everyone,
In this theme I’m working on
I have all my uploaded pictures in the assets directory as follows:
assets/
└── uploads
├── 2009
│ └── 10
│ └── silver-slack.png
├── 2010
│ ├── 10
│ │ └── screenshot-5.jpg
│ └── 11
│ └── nimoy-spock.jpg
├── 2011
│ ├── 07
│ │ ├── Boy-on-Mount-Fuji-large.jpg
│ │ ├── Choshi-in-Shimosa-Province-Soshu-Choshi-large.jpg
│ │ ├── Hibiscus-and-Sparrow-large.jpg
[...]
If I call them inside my content from a shortcode there’s no problem, but what I’m failing to achieve is to use one of those pictures as header background image called from a partial.
If you look at the theme, I call the partial head.html
which calls the partial head-addition.html
Inside the head-addition.html
file I try to set an image as header background if it is declared in the front matter of the page I’m rendering, but hugo complains:
execute of template failed: template: partials/head-addition.html:10:36: executing "partials/head-addition.html" at <$image.Permalink>: nil pointer evaluating resource.Resource.Permalink
And I can’t figure out why.
In the Front Matter of the article I specify:
---
title: "blabla"
[...]
featured_image: "uploads/2020/11/nimoy-spock.jpg"
[...]
Can you guys help me pinpoint the mistake I’m obviously overlooking?
Thanks a lot in advance