Code Monkey home page Code Monkey logo

pelican-sitemap's Introduction

Sitemap

(Copied from https://github.com/getpelican/pelican-plugins/tree/master/sitemap)

This plugin generates plain-text or XML sitemaps. You can use the SITEMAP variable in your settings file to configure the behavior of the plugin.

The SITEMAP variable must be a Python dictionary and can contain these keys:

  • format, which sets the output format of the plugin (xml or txt)

  • priorities, which is a dictionary with three keys:

    • articles, the priority for the URLs of the articles and their translations
    • pages, the priority for the URLs of the static pages
    • indexes, the priority for the URLs of the index pages, such as tags,
      author pages, categories indexes, archives, etc...

    All the values of this dictionary must be decimal numbers between 0 and 1.

  • changefreqs, which is a dictionary with three items:

    • articles, the update frequency of the articles
    • pages, the update frequency of the pages
    • indexes, the update frequency of the index pages

    Valid frequency values are always, hourly, daily, weekly, monthly, yearly and never.

You can exclude URLs from being included in the sitemap via regular expressions. For example, to exclude all URLs containing tag/ or category/ you can use the following SITEMAP setting.

SITEMAP = {
    'exclude': ['tag/', 'category/']
}

If a key is missing or a value is incorrect, it will be replaced with the default value.

You can also exclude an individual URL by adding metadata to it setting private to True.

The sitemap is saved in <output_path>/sitemap.<format>.

Note

priorities and changefreqs are information for search engines. They are only used in the XML sitemaps. For more information: <http://www.sitemaps.org/protocol.html#xmlTagDefinitions>

Example

Here is an example configuration (it's also the default settings):

# Where your plug-ins reside
PLUGIN_PATHS = ['/where/you/cloned/it/pelican-plugins/', ]
PLUGINS=['sitemap',]

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

pelican-sitemap's People

Contributors

sharmaeklavya2 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.