githubjekyllgithub-pagesjekyll-theme

GitHub Pages: Image From Link Not Showing


I used to have my website hosted through Shopify, and when I linked to it in my LinkedIn job description the logo showed up. I've since moved my website to GitHub Pages, and now the logo is blank when I link to it in LinkedIn (or anywhere else for that matter). Is there something I can do to fix this, or is it just a con of GH Pages?

enter image description here


Solution

  • It always helps to include a link to the codebase for reference, but it looks like you're likely working with this repo on your GitHub profile.

    It's possible that Shopify or a theme you were using before included these by default, but typically you have to specify the preview image in your site's metadata. The preview images for formatted links are pulled from an Open Graph image property, which you define in a meta tag in your HTML's <head> section (see the OG documentation here). So, in your head include file, you'd add a meta tag like this:

    <meta property="og:image" content="https://graemeharrison.com/assets/img/logo.png" />
    

    Then, ideally, you'll include this head file in each layout file so that it's included in each page's HTML.