I believe the internal template requires the cover/featured image to be in the same directory as the Markdown file, not in a subdirectory to be ‘autodetected’. You have the images in subdirectory of the page bundle.
I think the documentation could be updated for page bundles as it states
Where can the Resources live?
At any directory level within the leaf bundle directory.
This seems to contradict the requirement to use opengraph template as it states
Hugo uses the page title and description for the title and description metadata. The first 6 URLs from the images array are used for image metadata. If page bundles are used and the images array is empty or undefined, images with filenames matching *feature* or *cover*,*thumbnail* are used for image metadata.
I may have misunderstood it but it was confusing to me at first.
I understand the confusion. It’s difference between what the .Resources functions can use and what the internal template (that gaetawoo showed) uses in its implementation. For an end user, especially new one, “it’s all Hugo” because the difference between ‘core’ Hugo features like .Resources and convenience[1] things like the Open Graph template is not spelled out (that I recall).
[1]: The internal templates can all be replaced with your own versions and if they weren’t included in the Hugo release you would be required to supply them, instead of having a built-in version.
Agreed and it makes sense now, it’s just another convenient feature that Hugo offers which isn’t part of core Hugo features. Eventually i am planning to create one on my own as I would need some granular control over SEO. Whatever Hugo provides now works just fine.
Thank you for your reply… My confusion was “At any directory level within the leaf node”. Technically page bundles can look for resources at any directory level (including subdirectories) But that was not the same case for open graph. It is specifically looking for page resources at the parent level (leaf node) $images.GetMatch "*feature*"
I didn’t take a look at the template earlier but i am now aware that i could modify the path to $images.GetMatch "images/*feature*" to specify the sub level.