Integrating social meta tags into Jekyll

Social media meta tags allows us to optimize for sharing Twitter, Facebook, Google+ and Pinerest by defining exactly how titles, descriptions, images and more appear in social streams. There’re various ways but following social meta tags is the best method to integrating into Jekyll.

A lot of these will even cross-share the tags. For example, Google+ will actually use Facebook’s Open Graph tags if their available. All in all, the following code is a great start.

If your blog or product landing page is using using Jekyll or GitHub Pages, it can now be optimized for SEO. To enable the Jekyll SEO tag plugin, you must add the following line to your site’s _config.yml file:

gems:
-jekyll-seo-tag

And by adding a simple {% seo %} tag right before </head>, Jekyll will automatically add SEO metadata to each page. It even accounts for the page title, in addition to the description, canonical URL, next (and previous) URL and post metadata.

When you share a post to Facebook, LinkedIn, Twitter or other social networks, the tag makes sure content is displayed richly. The functionality comes courtesy of the Jekyll SEO plugin (GitHub Pages compatible), which GitHub says “provides a battle-tested template of crowdsourced best-practices.”

Validating

Be sure to check one of your example posts via the different social media metadata validator.