How To Add Meta Descriptions to Middleman Pages

March 14, 2018

The ability to tweak meta descriptions and titles to improve click-through rates is a key part of SEO. Fortunately, it takes about 30 seconds to add meta descriptions and titles in the Middleman static site generator.

Add the following to layout.erb between the head tags:

Then specify a description in the YAML frontmatter. Remember that the upper limit for meta descriptions is 160 characters.

title: On the Origin of Species
date: '1859-11-24 00:00:00'
- evolution
description: The scientific theory that     
populations evolve over the course of     
generations through a process of    
natural selection.

You can confirm that the meta description is working by viewing the source.