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

gulp-sitemap

Package Overview
Dependencies
Maintainers
1
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-sitemap

Generate a search engine friendly sitemap.xml using a Gulp stream

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.8K
increased by20.23%
Maintainers
1
Weekly downloads
 
Created
Source

gulp-sitemap

Generate a search engine friendly sitemap.xml using a Gulp stream

NPM Version Gittip Dependencies

Easily generate a search engine friendly sitemap.xml from your project.

:bowtie: Search engines love the sitemap.xml and it helps SEO as well.

Install

Install with npm

npm i -D gulp-sitemap

#or use the long and tiring version:
npm install --save-dev gulp-sitemap

Example

var gulp = require('gulp');
var sitemap = require('gulp-sitemap');

gulp.task('sitemap', function () {
    gulp.src('build/**/*.html', {
        read: false
    }).pipe(sitemap())
        .pipe(gulp.dest('build/'));
});
  • File content isn't necessary when reading files - so to speed up building - use the {read:false} on gulp.src.
  • index.html will be turned into directory path /.
  • 404.html will be skipped automatically. No need to unglob it.

Example with all options and their defaults

var gulp = require('gulp');
var sitemap = require('gulp-sitemap');

gulp.task('sitemap', function () {
    gulp.src('build/**/*.html', {
        read: false
    }).pipe(sitemap({
        fileName: 'sitemap.xml',
        newLine: '\n',
        changeFreq: 'daily',
        priority: '0.5',
        siteUrl: '',
        spacing: '    '
        }))
    .pipe(gulp.dest('build/'));
});

Options

fileName

Determine the output filename for the sitemap. Default: sitemap.xml.

siteUrl

What is your website's url. This gets prepended to all documents locations. Default: ``.

changeFreq

Gets filled inside the sitemap in the tag <changefreq>. Default: daily.

priority

Gets filled inside the sitemap in the tag <priority>. Default: 0.5.

newLine

How to join line in the target sitemap file. Defaults to your system OS or \n.

spacing

How should the sitemap xml file be spaced. You can use \t for tabs, or with 2 spaces if you'd like. Default: (4 spaces).

Thanks

To grunt-sitemap for the inspiration on writing this.

License

MIT ©2014 Gilad Peleg

Keywords

FAQs

Package last updated on 02 Mar 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