Adding meta description to Jekyll

Jekyll is a blog aware static website generator written in Ruby that uses Liquid for templating and Markdown or Textile for writing posts and pages. Jekyll also supports CSS pre-processors like SASS, LESS. Here is an uncomplicated way to add meta description to your Jekyll powered website.

Meta description helps search engine bots display a summary to a website’s post or page and helps the user get a concise explanation of what content he/she is about to view. The description does not need to be a paragraph of a specific post or page, it can be a small line to explain what the content is about.

Jekyll uses Liquid for templating which makes it easy to add more markup to your source code.

  • Adding description: string to your _config.yml example
description: This is an awesome website

Add these lines to your head.html

{% if page.description %} {{page.description}} {% else %} {{site.description}} {% endif %}

You can now add description: string to front-matter of your post or page and add a small summary to it.

Then build your website.

jekyll build

Now you have meta description for your Jekyll based website.

Leave a Reply

Your email address will not be published. Required fields are marked *

Up Next:

How to fix horizontal scroll in Twitter Bootstrap

How to fix horizontal scroll in Twitter Bootstrap