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-plugin-sitemap

v0.0.6

Published

Assemble的Sitemap生成插件

Downloads

9

Readme

assemble-plugin-sitemap NPM version Build Status 依赖模块状态

Assemble的Sitemap生成插件

Table of Contents

Quickstart

包安装:

npm install assemble-plugin-sitemap --save

Gruntfile.js定制:

module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    assemble: {
      options: {
        plugins: ['assemble-plugin-sitemap']
      },
      ...
    }
  });
  grunt.loadNpmTasks('assemble');
  grunt.registerTask('default', ['assemble']);
};

Options

了解更多sitemap查看sitemaps.org

homepage

Type: String
Default: homepage (来自package.json)

Site URL

changefreq

Type: String

链接的更新频率选项,默认是文件中ymal定义的changefrq值,然后是选项option.changefre值,最后是weekly

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

priority

Type: String

指定此链接相对于其他链接的优先权比值,此值定于0.0 - 1.0之间,默认是文件中ymal定义的priority值,然后是选项option.priority值,最后是0.5

exclusions

Type: Array
Default: ['404']

排除列表,默认是404页面。

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

robot

Type: Boolean
Default: true

生成robots.txt根据exclusions 列表,所有任务汇总成为一个。

注意:robot的生成路径,如果存在relativedest,则相对于dest,否则page,一般为了汇总一个,都设置relativedest和dest,确定根目录,而且可以存放robot.txt

relativedest: true

Type: Boolean

生成sitemap内容链接的相对路径开关,配合dest选项,内容链接输出路径相对于dest,否则路径默认是page输出路径。

注意sitemap本身路径总是page的输出路径

dest

Type: String

生成sitemap的相对路径

sitemap

Type: Boolean Default: true 这个选项是在markdown文档中的,是否把该文档写入sitemap中,默认是true

Usage Examples

基本用法

最基本用法:

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

结果

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

高级

assemble: {
  blog: {
    options: {
      plugins: ['assemble-plugin-sitemap'],
      sitemap: {
        homepage: 'http://www.gdcome.com',
            changefreq: 'daily',
            priority: '0.8',
            exclude: ['50x', 'foo'],
            robot: false,
            urldelete: 'test/'
      }
    },
    files: {
      './blog/': ['./templates/blog/*.hbs']
    }
  }
}

结果

./blog/sitemap.xml

Author

GoldCome

  • Github: https://github.com/GoldCome
  • Blog:http://www.gdcome.com
  • QQ/Email: [email protected]

Release History

  • 2014-02-18   v0.0.0   更具我的项目重构sitemap生成器
  • 2014-02-19   v0.0.1   修正robot选项失灵,默认false现在 增加drone持续集成测试
  • 2014-02-19   v0.0.2   robot修改为默认为true
  • 2014-02-21   v0.0.3   重构README.md文档模板 去除不必要的文件 增加sitemap选项,是否写入sitemap 重命名插件名称为index.js 用bootstrap完善测试模板
  • 2014-03-09   v0.0.4   拉取源gihub整合 priority也可以在page定义 为页面增加sitemap开关
  • 2014-03-09   v0.0.5   修正relativedest生成sitemap会覆盖问题
  • 2014-03-13   v0.0.6   修正README.md和重新命名发布到npm 修正在markdown中定义sitemap文档无法再robots体现 重构robots生成器

License

Copyright (c) 2014 goldcome, contributors. Released under the license


This file was generated on Saturday, March 15, 2014.