Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

metalsmith-sitemap

Package Overview
Dependencies
Maintainers
1
Versions
15
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metalsmith-sitemap

A metalsmith plugin for generating a sitemap.xml file.

  • 0.0.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
469
increased by9.07%
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 04 Dec 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc