npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

assemble-middleware-sitemap

v0.2.5

Published

Sitemap middleware for Assemble

Downloads

9

Readme

assemble-middleware-sitemap NPM version Build Status

Sitemap middleware for Assemble

Table of Contents

Install

Install with npm:

npm i assemble-middleware-sitemap --save-dev

Next, register the middleware with Assemble:

assemble: {
  options: {
    middleware: ['assemble-middleware-sitemap', 'other/middleware/*']
  }
}

Visit the middleware docs for more info or for help getting started.

Options

See sitemaps.org for detail XML tag definitions.

dest

Type: String
Default: undefined

Sitemap destination. If not set, fallback to assemble destination.

homepage

Type: String
Default: homepage (from package.json)

Site URL

changefreq

Type: String
Default: weekly

How frequently the page is likely to change. This value provides general information to search engines and may not correlate exactly to how often they crawl the page. Valid values are:

  • always
  • hourly
  • daily
  • weekly
  • monthly
  • yearly
  • never

priority

Type: Float
Default: 0.5

The priority of this URL relative to other URLs on your site. Valid values range from 0.0 to 1.0. This value does not affect how your pages are compared to pages on other sites—it only lets the search engines know which pages you deem most important for the crawlers.

exclusions

Type: Array
Default: ['404']

Pages to omit from the sitemap.

options: {
  sitemap: {
    exclusions: ["foo", "bar"],
  },
  files: {
    ...
  }
}

relativedest

Type: String / Boolean
Default: false

Path to which the URLs in Sitemap and Robots should be relative to. true is equal to the destination path dest and false is equal to the root directory.

robot

Type: Boolean
Default: true

Generate robots.txt from exclusions list.

Usage Examples

Simple

To simplify might do something like:

assemble: {
  blog: {
    options: {
      plugins: ['assemble-middleware-sitemap'],
    },
    files: {
      './blog/': ['./templates/blog/*.hbs']
    }
  }
}

Result

./blog/sitemap.xml
./blog/robots.txt

Advanced

assemble: {
  blog: {
    options: {
      plugins: ['assemble-middleware-sitemap'],
      sitemap: {
        homepage: 'http://assemble.io',
            changefreq: 'daily',
            priority: '0.8',
            exclude: ['50x', 'foo'],
            robot: false
      }
    },
    files: {
      './blog/': ['./templates/blog/*.hbs']
    }
  }
}

Result

./blog/sitemap.xml

Contributing

We welcome all kinds of contributions! The most basic way to show your support is to star the project, and if you'd like to get involved please see the Contributing to assemble-middleware-sitemap guide for information on contributing to this project.

Changes

DATE VERSION CHANGES

  • 2014-06-01 v0.2.5 fix sitemap and robots not generated,relativedest can be a path now
  • 2014-06-01 v0.2.4 added sitemap URL to robots.txt,added relativedest to options
  • 2014-05-03 v0.2.3 fixes toc,Change docs to use verb
  • 2014-03-26 v0.2.2 Change from plugin to middleware
  • 2014-02-21 v0.2.1 fix option.robot was ignored and always true 0159123,(feat) add option.dest and use as output path,fix option.robot was ignored and always true,(feat) add option to overwrite changefreq per file,cosmetical changes (code
    formatting, naming, simplify),(wip) enable globbing patterns for
    option.exclude
  • 2014-02-05 v0.2.0 Generation of robots.txt will now respect the relativedest option.
  • 2014-02-02 v0.1.9 Fix sitemap destination
  • 2014-01-28 v0.1.8 Use external library,Get pages from assemble object
  • 2014-01-03 v0.1.7 Add relativedest option
  • 2013-12-12 v0.1.6 Fix plugin name in Usage Examples,Update deps
  • 2013-11-28 v0.1.4 Updates dependencies to work with Grunt 0.4.2,[object Object],Add TOC to
    docs
  • 2013-10-20 v0.1.3 Fix sitemap and robots.txt generated on every folder,Update docs
    options:exclusions
  • 2013-10-18 v0.1.2 Fix homepage
  • 2013-10-17 v0.1.1 Add option to generate robots.txt,Change name to
    assemble-contrib.sitemap,Move to Assemble main repo
  • 2013-10-01 v0.1.0 First commmit.,Add option to exclude

Author

Hariadi Hinta

License

Copyright (c) 2014 Hariadi Hinta, contributors.
Released under the MIT license


Related projects

Here are some related projects you might be interested in from the Assemble core team.

Visit assemble.io/assemble-middleware for more information about Assemble middleware.


This file was generated by grunt-verb on June 03, 2014.