Closed gellenburg closed 1 year ago
It should show up automatically with that naming even without frontmatter parameters as it glob matches *feature*
. But the frontmatter you have should work too. Are you not seeing it in your post at all or just not in SEO metadata like OG and Twitter cards? Have you tried clearing cache?
Sorry just saw your reply.
Are you not seeing it in your post at all or just not in SEO metadata like OG and Twitter cards?
Not seeing it at all.
Have you tried clearing cache?
Yes. Different browsers even. ;-)
This is the command string I'm using to render the site:
hugo server --buildDrafts --buildExpired --buildFuture --cleanDestinationDir --disableFastRender --disableLiveReload --forceSyncStatic --gc --ignoreCache --noHTTPCache --renderStaticToDisk --renderToDisk
And there is physically no featured image rendered out in the HTML that hugo generates.
No problem @gellenburg. After further investigation, I realized the issue is related to page bundles. Page bundle resources are only available in a directory with an index.md
or _index.md
file. Generally when using page bundles, especially in nested sections, the name of the post should be index.md
instead of the title of the post.
To fix this, you could create a page bundle by adding an additional directory under 2023/08/
(e.g. 2023/08/name-of-post/
and use an index.md
file for your post (instead of 01 - Signed the papers...
) alongside the images in that directory. Alternatively, if you only expect to have a single post within 2023/08/
you could create the index.md
there and it would be considered a leaf bundle. There are archetypes for creating these automatically within sections (see docs).
With an _index.md
, that would make it a branch bundle which is more appropriate for sections. But generally a leaf bundle is what you want for individual posts, and a branch bundle is only necessary if you want to create a section page for that directory. I hope that makes sense. I don't have much insight into how you want to structure your posts so if more clarification is needed for your specific use case I'd be happy to provide it.
Not sure why I didn't see this previously, so apologies for that. I could've sworn I added support for featured images to fall back to global resources as well but I did not. If that were the case, you would be able to place the images in /assets/
instead of creating a page bundle for them. Perhaps that's something to consider supporting in the future.
To fix this, you could create a page bundle by adding an additional directory under
2023/08/
(e.g.2023/08/name-of-post/
and use anindex.md
file for your post (instead of01 - Signed the papers...
) alongside the images in that directory.
That fixed it! Many thanks! I was just about ready to give up. :-) Appreciate your time and help.
Awesome, glad that helped.
Describe the bug
Featured Images for a post aren't being rendered/ working.
To Reproduce Steps to reproduce the behavior:
feature_image =
to a post:hugo server
.)Expected behavior I expected a featured image to be rendered into the page.
Screenshots See above.
Desktop (please complete the following information):
Smartphone (please complete the following information):
Additional context
hugo server