kaushalmodi / ox-hugo

A carefully crafted Org exporter back-end for Hugo
https://ox-hugo.scripter.co
GNU General Public License v3.0
883 stars 132 forks source link

Add a thumbnail image to site index along with `.summary` #748

Open fpdotmonkey opened 6 hours ago

fpdotmonkey commented 6 hours ago

Is there a known way to add thumbnail images for each post to the site index? I currently am able to do this by providing :EXPORT_HUGO_CUSTOM_FRONT_MATTER: :thumbnail /path/to/thumb.png and using that in my theme, but using full resolution images tanks my load times. I see that there's the .Resize function in Hugo that would help, but I haven't had any luck getting Hugo to be able to find my assets in static/ox-hugo/.

kaushalmodi commented 5 hours ago

I haven't tinkered with Hugo image processing, but from its docs, the images need to be in assets/images/ and not static: https://gohugo.io/content-management/image-processing/#global-resource

kaushalmodi commented 5 hours ago

Auto-copying of images to assets/images/ is not supported. But if you have a page-specific image resource in the page bundle, it might be more convenient for you to manage: https://gohugo.io/content-management/image-processing/#page-resource

kaushalmodi commented 5 hours ago

Auto-copying of images to assets/images/ is not supported. But here is one way you can use images from page bundle. You will need to update your Hugo theme to pick the image from page bundle, post-process that and use for thumbnail

image

kaushalmodi commented 5 hours ago

Oh yes, and the Org source for above:

image