Adding og image on jekyll posts

Jekyll og images

Facebook uses the Open Graph protocol (OG) which enables any web page to become a rich object in a social graph.

The code for og:image need to be added on header tag of the site as in the example below:

<head>
<meta property="og:locale" content="en_US">
<meta property="og:type" content="article">
<meta property="og:title" content="Adding og image on jekyll posts">
<meta property="og:description" content="Adding og image on jekyll posts, jekyll og image.">
<meta property="og:url" content="https://oxwebs.com/jekyll/jekyll%20og%20image/">
<meta property="og:site_name" content="Oxwebs - Developer's Journal">
<meta property="og:image" content="https://oxwebs.com/images/">

<meta property="og:image:width" content="637" />

The other thing that you would need to do is to update YAML in the forn matter of your post/article like in the example below:

---
layout: post
title: Jekyll Tutorials
description: Tutorials on Jekyll
tags: jekyll
image: some-image.jpg
---

In this way jekyll know that this post has an image associated with it, so when you share this post this image will be shown witht the article.