Enhancing Jekyll SEO with Image Thumbnails
I was frustrated when sharing links on social networks because my posts weren’t displaying a thumbnail image. Then, I discovered that Jekyll, along with the theme I’m using, automatically includes Open Graph tags for images thanks to the jekyll-seo-tag plugin.
To enable images, all I needed to do was add an image
key to the front matter of my posts. Here’s an example:
image:
path: /assets/images/post-image.webp
alt: "Post Image Alt Text"
If you want a default image to be used when no image is specified, you can set it in the _config.yml
file:
defaults:
-
scope:
path: "" # an empty string here means all files in the project
values:
image:
path: /assets/images/default-social-share-image.png
alt: "Epicserve Logo"