Newbie: Where is e.g. featured_image documented?

Hugo newbie here.

I’ve just gotten started with getting-started/quick-start and imported my wordpress blog with exitwp-for-hugo. So far so good.

My future front page is now a wall of text. So off to the docs to figure out how to spice up the “Recent Posts” list so each post has an image and a post date.

About the image pr. post first. I didn’t find anything interesting in the docs. (Nothing in “Front Matter” (link removed) nothing in “Page Variables” (link removed)).

I did however discover these discourse posts:

So it seems there is something called featured_image (and maybe featured_image_caption) in the front matter, and sure enough featured_image works. Now my question: where is this documented? Can I expect this to work with all themes or just ananke? Or are these (in my mind basic things), not supported generally but supported in different ways by each template? And sure, I can patch the hell out of the template I end up choosing, with all the merge conflicts that creates. I’d really like to avoid that - especially 15 minutes into my Hugo experience.

I also would like to get the date to likewise appear in the “Recent Posts” list? Is there a standard way to do that?

Mostly I want to get a grasp of what I’m missed looking through the documentation and where to find the featured_image documentation.

P.S.: My post was filled with good and appropriate links, but it seems I can only have two links. Aaarrhhh…

Hi there,

That’s a feature of the theme Ananke, documented here: https://github.com/budparr/gohugo-theme-ananke#change-the-hero-background

Each theme may have a different way of handling this feature.

Do you mean the Recent Articles list that appears on the homepage? You can override the theme’s layout file for the homepage and add the {{ .Date }} where you want it.

Layout lookup rules here: https://gohugo.io/templates/lookup-order/
Date format docs here: https://gohugo.io/functions/format/#hugo-date-and-time-templating-reference

Yeah, I was affraid of that.

Essentially forking the layout. Yeah, I was affraid of that too…

But tremendous thanks for the answer, @pointyfar. It is very much appreciated.

Sure. Or overriding. Things to look for in a theme is how modular the structure, for strategic overrides.

It sounds complicated, but in practice it isn’t that bad. “Child theming”. :slight_smile:

Ahh, ok, I didn’t realize that was a thing… Thank you, I’ll give it a shot.

Hi @pmorch, I answered a question about overriding on the forums the other day - you might find the answer useful

1 Like