Giter Club home page Giter Club logo

metalsmith-sitemap's Introduction

metalsmith-sitemap

This provides a metalsmith plugin to generate a sitemap according to the Sitemaps Protocol. There are four pieces of information possible for on any page. The URL of the page (loc), the last modified date (lastmod), the change frequency (changefreq) and the priority. loc is the only value that is required.

###Options

var Sitemap = require('metalsmith-sitemap');

Sitemap({
    ignoreFiles: [/test.xml/], // Matched files will be ignored
    output: 'sitemap.xml', // The location where the final sitemap should be placed
    urlProperty: 'seo.canonical', // Key for URL property
    hostname: 'http://www.metalsmith.io', // hostname to use for URL, if needed
    modifiedProperty: 'modified', // Key for last modified property
    defaults: { // You can provide default values for any property in here
        priority: 0.5,
        changefreq: 'daily'
    }
})

Note that the property keys (urlProperty, modifiedProperty) can use the dot syntax to traverse the front matter object for any given page.

###Front Matter There are a few properties that Sitemap will use from a files front matter. The first two, mentioned above, are configurable. The next two are expected to be at a set location. These are page specific values for priority and changefreq which should be at sitemap.priority and sitemap.changefreq respectively.

The last piece of front matter that the sitemap pays attention to is another way of ignoring files. If a file has private set to true in the front matter it will be skipped in the sitemapprivate set to true in the front matter it will be skipped inthe sitemap.

metalsmith-sitemap's People

Contributors

1kevgriff avatar avioli avatar boushley avatar edorsey avatar jseppi avatar wilsaj avatar

Watchers

 avatar  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.