Hi everyone, and first thanks for all the extremely valuable information I’ve found here so far
I made my website (https://clement-martin.fr) using Hugo and Papermod (which I modified here and there) and I’m fairly satisfied with the result, but I have one problem: when I share my posts on social media (Bluesky, discord etc.), the cover image I’ve defined for those doesn’t show up.
It does appear if I link to the homepage (see below), but it doesn’t for other pages.
I don’t think any solution is mentioned on the PaperMod repo, so I come asking for more general solutions. Has anyone else already had this issue? Is there a workaround?
Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.
Well, the HTML tries to load https://clement-martin.fr/images/ignition.jpg and can’t find it. Ensure that the img’s src attribute is correct – if you don’t share your repository, that’s all one can suggest.
I’m sorry I haven’t posted my repository, but I’m not using one! I’m self-hosting on a private server.
That being said, I didn’t know about heymeta.com, and it’s quite helpful: it shows that opengraph (or whatever else is picking up the image from my post) looks for it in /static. It must have to do with the fact that my site is multilingual and organized in folders. I assume I’ll have to modify layout/partials/opengraph.html or layout/partials/_funcs/get-page-images.html (as seen in PaperMod’s repo GitHub - adityatelange/hugo-PaperMod: A fast, clean, responsive Hugo theme.)