A practical SEO setup for a Jekyll site

Jekyll gives you complete control over the generated HTML, but it does not make every SEO decision for you. Two plugins cover the repetitive parts I would rather not maintain by hand: metadata and a sitemap.

Generate consistent metadata

The jekyll-seo-tag plugin adds metadata for search engines and social networks using values already present in your site and page front matter.

Jekyll SEO tag adds the following meta tags to your site:

You can write these tags yourself, but the plugin keeps the implementation consistent across posts and saves a surprising amount of template code.

Add it to the site’s Gemfile:

gem 'jekyll-seo-tag'

Add the following to your site’s _config.yml:

plugins:
  - jekyll-seo-tag

Jekyll versions older than 3.5.0 use the gems key instead of plugins. Then add the tag before </head> in the site’s layout:

{% seo %}

The plugin’s documentation covers the front-matter and site values used by each tag. The generated description can only be as good as the description you provide, of course. Plugins have yet to solve writing.

Add a sitemap

A sitemap tells crawlers which URLs the site contains and can include details such as modification dates and alternate language versions. The jekyll-sitemap plugin generates a sitemap.org-compatible file at /sitemap.xml.

Add gem 'jekyll-sitemap' to the Gemfile, run bundle, and enable it in _config.yml:

url: "https://example.com"
plugins:
  - jekyll-sitemap

The url must be the real canonical origin because the plugin uses it to build absolute URLs.

Point crawlers to the sitemap

A robots.txt file can tell crawlers where to find the sitemap. Create it in the project root:

---
layout: none
---
User-agent: *
Sitemap: {{ site.url }}/sitemap.xml

This is a foundation, not a promise of rankings. Useful content, crawlable links, good performance, and sensible page structure still matter. The plugins simply handle metadata and discovery reliably, which is exactly the kind of boring work a plugin should do.