Pelican Sitemap

Mon 05 September 2016
Category: meta

Added the Pelican sitemap plugin to create a sitemap and configured it within the pelicanconf.py config file.

From http://www.sitemaps.org/

What are Sitemaps?

Sitemaps are an easy way for webmasters to inform search engines about pages on their sites that are available for crawling. In its simplest form, a Sitemap is an XML file that lists URLs for a site along with additional metadata about each URL (when it was last updated, how often it usually changes, and how important it is, relative to other URLs in the site) so that search engines can more intelligently crawl the site.

Web crawlers usually discover pages from links within the site and from other sites. Sitemaps supplement this data to allow crawlers that support Sitemaps to pick up all URLs in the Sitemap and learn about those URLs using the associated metadata. Using the Sitemap protocol does not guarantee that web pages are included in search engines, but provides hints for web crawlers to do a better job of crawling your site.

The pelican sitemap module does not exist at pypi so to install it, I cloned the pelican plugins repository then copied the sitemap module into a plugins directory local to this blog.

That’s certainly not the hippest gittest way of handling it, but it works…

Settings in pelicanconf.py

Enabled the plugin

PLUGINS = [
    # ...
    'sitemap',
    # ...
]

Configured it as:

SITEMAP = {
    'format': 'xml',
    'priorities': {
        'articles': 0.5,
        'indexes': 0.5,
        'pages': 0.5
    },
    'changefreqs': {
        'articles': 'weekly',
        'indexes': 'weekly',
        'pages': 'monthly'
    }
}

Category: meta Tagged: pelican pelican-plugins change-log

Comments