konstantinmuenster / gatsby-theme-portfolio-minimal

A Gatsby Theme to create modern one-page portfolios with a clean yet expressive design.
MIT License
152 stars 86 forks source link

og:image property seems to be inferred #55

Open TheStanHo opened 1 month ago

TheStanHo commented 1 month ago

Hello! Been using this lovely theme alot for writing blogs. Apologies if this isn't an issue (not a dev 😅)

I'm having an issue though ever since I deployed the most recent blog the og:image property is not found on the page 2024-06-02 12_46_29-DevTools - thestanho github io_PythonScriptingFabricLibrary_

Where as say for the one for the live demo it is. 2024-06-02 12_46_58-DevTools - gatsby-theme-portfolio-minimal netlify app_my-first-article_

Linkedin Post inspector

When I look at LinkedIn Post inspector for it - here You can see that the image property it is using is not the correct image/url 2024-06-02 12_47_49-Post Inspector

Facebook url inspector

When using the facebook one here.

2024-06-02 13_12_36-Sharing Debugger - Meta for Developers

Question

I'm abit lost onto why this is happening as it has only happened on my most recently deployment but all I've done was add the markdown.md for the article and left the code untouched.

Perhaps it depends on the website. But when I use to post it on LinkedIn the correct image would be inferred for the og:image tag. But looking for the tag via inspect elements I cannot find it being set anymore

You can see in the article markdown here that the banner: src: is pointing to the correct image that would normally be used for the og:image

Any insight in this would be appreciated.

konstantinmuenster commented 1 month ago

Hey @TheStanHo!

I think I know what might be a bit confusing... the theme doesn't yet support og:image properties for individual blog posts. Your screenshot of the live demo shows the og:image that is referenced inside the settings.json file. If this is set, we use this thumbnail image globally for the entire page.

In your case, since you probably haven't set this property inside settings.json, each site infers an image automatically. So, there's a bit of luck involved.

Ideally, we could extend the theme so that it sets the correct og:image on every blog post. Not sure when I get to that, though 😅

TheStanHo commented 4 weeks ago

Hey @konstantinmuenster !

Thanks for the reply, yeah what you said makes sense to me now and I get why it's inferred. You're correct about me not setting it in settings.json

And haha no worries on it!