A simple Jekyll include file to add metadata tags for search engines and social networks to better index and display your site's content. No plugin required.
It adds the following meta tags to your site:
The usage is compatible with the plugin Jekyll SEO Tag, which provides a battle-tested template of crowdsourced best-practices.
Just place the social-metatags.html
into your _includes
folder and add this before your </head>
html tag:
{% include social-metatags.html %}
The metatags of any of the following fields will be created, if included in your site's _config.yml
:
title
- Your site's title (e.g., Ben's awesome site, The GitHub Blog, etc.)
description
- A short description (e.g., A blog dedicated to reviewing cat gifs)
image
- URL to an image associated with the website (e.g., /assets/screenshot-jumbo.png
)
author
- global author information (see below)
twitter:username
or twitter:site
- The author/site's Twitter handle. You'll want to describe it like so:
twitter:
username: personal_handle
site: publisher_handle
facebook
- The following properties are available:
facebook:app_id
- a Facebook app ID for Facebook insightsfacebook:publisher
- a Facebook page URL or ID of the publishing entityfacebook:admins
- a Facebook user ID for domain insights linked to a personal accountfacebook:authors
- a Facebook user ID linked to a personal accountYou'll want to describe one or more like so:
facebook:
app_id: 1234
publisher: 1234
admins: 1234
authors: 1234
The metatags of any of the following fields will override the site's ones, if included in your post/page file:
title
- The title of the post, page, or documentdescription
- A short description of the page's contentimage
- URL to an image associated with the post, page, or document (e.g., /assets/page-pic.jpg
)author
- Page-, post-, or document-specific author information (name)twitter:username
- The site's Twitter handle. You'll want to describe it like so:facebook
- The following properties are available:facebook:publisher
- a Facebook page URL or ID of the publishing entitykeywords
, tags
, categories
, category
- Page-, post-, or document-specific keywords informationdate
- Page-, post-, or document-specific publishing datemodified_date
- Page-, post-, or document-specific modified date