Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    gatsby-plugin-sitemappublic

    gatsby-plugin-sitemap

    Create a sitemap for your Gatsby site.

    Install

    npm install --save gatsby-plugin-sitemap

    How to Use

    // In your gatsby-config.js
    siteMetadata: {
      siteUrl: `https://www.example.com`,
    },
    plugins: [
      {
        resolve: `gatsby-plugin-sitemap`
      }
    ]

    Above is the minimal configuration required to have it work. By default, the generated sitemap will include all of your site's pages, except the ones you exclude.

    Options

    The defaultOptions here can be overridden.

    We ALWAYS exclude the following pages: /dev-404-page/,/404 &/offline-plugin-app-shell-fallback/, this cannot be changed.

    Example:

    // In your gatsby-config.js
    siteMetadata: {
      siteUrl: `https://www.example.com`,
    },
    plugins: [
      {
        resolve: `gatsby-plugin-sitemap`,
        options: {
          output: `/some-other-sitemap.xml`,
          // Exclude specific pages or groups of pages using glob parameters
          // See: https://github.com/isaacs/minimatch
          // The example below will exclude the single `path/to/page` and all routes beginning with `category`
          exclude: ["/category/*", `/path/to/page`],
          query: `
            {
              site {
                siteMetadata {
                  siteUrl
                }
              }
     
              allSitePage {
                edges {
                  node {
                    path
                  }
                }
              }
          }`
        }
      }
    ]

    NOTE: This plugin only generates output when run in production mode! To test your sitemap, run: gatsby build && gatsby serve

    install

    npm i gatsby-plugin-sitemap

    Downloadslast 7 days

    7,257

    version

    1.2.22

    license

    MIT

    repository

    github.com

    last publish

    collaborators

    • avatar
    • avatar