Og_image doesn't seem to work on Minimal Mistakes

Hi !

I just have configured a website here aurelienchaumet.github.io with the really great Minimal Mistakes theme (thank you @mmistakes btw :metal:)
I ran bundle update, I read (I guess) all the doc and I read issues on github, but I couldn’t figure out with this…

I put an og_image in the _config.yml
og_image: /assets/images/site-logo.png
with an image placed on the right folder, but nothing displayed when I share the link of the webpage.
You can find my repo here https://github.com/aurelienchaumet/aurelienchaumet.github.io

Thanks by advance !!!

That value set in the config will only be used if the page has none of the following set:

  • page.header.og_image
  • page.header.overlay_image
  • page.header.image
  • page.header.teaser

Only if none of those are set, then is site.og_image used.

See your seo.html file

So I think the theme is working as intended.

Your global value is not showing on the homepage because you have this set.

_pages/home.md

---
header:
  overlay_color: "#5e616c"
  overlay_image: /assets/images/source.png
---

But on your About page, you don’t have that set.

view-source:https://aurelienchaumet.github.io/about/

So then it falls back to the config value.

<meta property="og:image" 
    content="https://aurelienchaumet.github.io//assets/images/site-logo.png">

First, thanks for your answer ! :pray:

What I don’t understand is that no page show any image when I try to share it…
I tried here for Twitter https://cards-dev.twitter.com/validator
and https://aurelienchaumet.github.io/about/ or home page doesn’t display any image…

Your paths don’t look right to me. There are extra forward slashes /
If I had to guess you either are using an older version of the theme that needs updating as you appear to have a fork and are using the remote_theme option. I wouldn’t do both. Remove the local files _includes, _layouts, etc from your repo.

If that doesn’t solve it then something may be off with how you’re setting url and baseurl in the repo. It looks like your paths are correct in the header nav and elsewhere across the site. Just all the meta SEO stuff has extra / slashes.

2 Likes

Ok, thanks a lot, I’m gonna update the fork and see what happens !

For the record, the error was the last option @mmistakes.
I had a backslash on the _config.yml at the end of the url setting…
url : "https://aurelienchaumet.github.io"
I already saw there were some trouble with the sitemap adress, with an excessive backlslash too.

I’m sorry I took your time for a mistake coming from me, and I really thank you for your time.
Moreover, I’m uptodate and the repo is much more cleaner ! :+1:

1 Like