LeNPaul / Lagrange

A minimalist Jekyll theme for running a personal blog powered by Jekyll and GitHub Pages
https://lenpaul.github.io/Lagrange/
MIT License
684 stars 671 forks source link

Incorrect og:image tag is generated #104

Open bminaiev opened 1 year ago

bminaiev commented 1 year ago

og:image meta tag is used to generate cards for social media (twitter/facebook/...). Currently, it is generated by the jekyll-seo-tag plugin based on post:image.

The problem is jekyll-seo-tag expects the image path to be full, while Lagrange expects it relative to assets/img.

In the example page, there is an og:image tag:

<meta property="og:image" content="https://lenpaul.github.io/Lagrange/mountains.jpg" />

which contains an incorrect path. So if you share a link to this page on Twitter, the image is not shown.

stfab commented 1 year ago

I had the same issue on my website. As a workaround, I removed the assets/img/ part from the image elements in _layouts/post.html and _layouts/home.html. And for all posts, I've added assets/img/ in front of the image path. This fixed the preview cards in social media for me.