I have a page bundle under content/post/post-name with an image under content/post/post-name/images/the-image.png.
My single.html calls a partial to help optimize the images and create a srcset. However, when the partial executes, the page.Resources.Get can’t seem to find the image from the page bundle.
The image.html partial doesn’t get a page context and the page function does not always return what you expect.
You may solve that by passing the page in context (or page containing the image) as additional argument to the partial patial "utilities/image.html (dict "src" .src page PAGE_IN_CONTEXT ...)
PAGE_IN_CONTEXT might be $, . or some other which depends on the implementation of the calling partial/layout…
You could start with $ and see which errors vanish (some do)…
In case you cannot find all you will have to share your repo - or at least a reproductible example
Oof. That makes sense, and also kinda sucks. The image.html partial is from the theme, and used all over in the theme libraries. Probably I’ll have to create a new partial with a parameter for the page context, while trying to suppress horrific memories of passing struct pointers around in C.
I still use the static directory to store my images. with a subdir for clarity. e.g. site/static/images and reference in the page as images: [/images/bl-jefferson.png] for metadata. Or , as part of the page or template like this: {{< figure src=“/images/cowboy_joke.jpg” width=“75%” title=“Makes you laugh” link=“/images/cowboy_joke.jpg”>}} I don’t know if this is going away as the code is changed. It does work on the latest release .148
I wanted to use page bundles to organize images that are related to the page without having to have a shadow directory in the …/assets or …/static structure. I preferred …/assets over …/static so that the partial I use can generate responsive srcset assets.