Question: Post image from Hugo page resources
See original GitHub issueI am using Frontmatter in connection with Hugo and wonder if it’s possible to somehow use images as article image on the dashboard when they are defined in the resources
section of the frontmatter.
frontmatter sample
---
...
resources:
- title: "caption"
id: "id1"
src: "header.jpg"
- title: "caption2"
id: "id2"
src: "header2.jpg"
---
I would expect the solution to show the image of the first resource (header.jpg
). This can of course be “hacked” by adding an additional frontmatter item with the header image, but that would not be used in the theme at all and only for Frontmatter to look nice.
Page Resources is a fairly integral piece of Hugos page bundle system. This would have to check if the first item is an actual image though, because other media types could take that place.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Page Resources - Hugo
In this example, first-post is a page bundle with access to 10 page resources including audio, data, documents, images, and video.
Read more >Guide for different ways to access your image resources
In this tutorial I will focus on different ways to handle images in Hugo. Learn how to find and select images in every...
Read more >Hugo Page Resources - Regis Philibert
In this article we'll cover Page Resources and its impact on the way we structure our content folders, what methods and properties it...
Read more >How to insert an image in my post on Hugo? - Stack Overflow
Option 1. Put all of your images in the static/ directory. · Option 2. Use sub-directories to hold the markdown file and any...
Read more >Image render hook does not work with page resources any more
0 on MacOS Catalina Yes, this error occurs with latest Hugo version. Before 0.64 this was possible: {{ $image ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
New beta version is available with this enhancement.
The preview image for block fields is not yet supported, but I’ll push a new update in a couple of minutes to have this supported as well.
In your case, what you have to do is update the
resources
field group as follows: