Socket
Socket
Sign inDemoInstall

gatsby-plugin-sitemap

Package Overview
Dependencies
Maintainers
2
Versions
524
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gatsby-plugin-sitemap - npm Package Compare versions

Comparing version 1.3.0-alpha.93f2e2a2 to 1.3.0-alpha.a0a09c94

6

internals.js
"use strict";
exports.__esModule = true;
exports.defaultOptions = exports.runQuery = exports.writeFile = undefined;
exports.defaultOptions = exports.regexExclude404 = exports.runQuery = exports.writeFile = undefined;

@@ -28,4 +28,6 @@ var _fs = require("fs");

var regexExclude404 = exports.regexExclude404 = /^(?!\/(dev-404-page|404)).*$/;
var defaultOptions = exports.defaultOptions = {
query: "\n {\n site {\n siteMetadata {\n siteUrl\n }\n }\n \n allSitePage(\n filter: {\n path: {ne: \"/dev-404-page/\"}\n }\n ) {\n edges {\n node {\n path\n }\n }\n }\n }",
query: "\n {\n site {\n siteMetadata {\n siteUrl\n }\n }\n\n allSitePage(\n filter: {\n path: {\n regex: \"" + regexExclude404 + "\"\n }\n }\n ) {\n edges {\n node {\n path\n }\n }\n }\n }",
output: "/sitemap.xml",

@@ -32,0 +34,0 @@ serialize: function serialize(_ref) {

{
"name": "gatsby-plugin-sitemap",
"version": "1.3.0-alpha.93f2e2a2",
"version": "1.3.0-alpha.a0a09c94",
"description": "Stub description for gatsby-plugin-sitemap",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -23,6 +23,41 @@ # gatsby-plugin-sitemap

Above is the minmal configuration required to have it work, however, note that
the [default
query](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-sitemap/src/internals.js)
only retrieves nodes of type `MarkdownRemark`. Any parameter in
`defaultOptions` can be overridden.
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 dev 404 page
(`/dev-404-page/`).
The [default query](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-sitemap/src/internals.js#L16)
as well as any of the other `defaultOptions` [here](https://github.com/gatsbyjs/gatsby/blob/master/packages/gatsby-plugin-sitemap/src/internals.js#L15)
can be overridden - for example:
```javascript
// In your gatsby-config.js
siteMetadata: {
siteUrl: `https://www.example.com`,
},
plugins: [
{
resolve: `gatsby-plugin-sitemap`
options: {
output: `/some-other-sitemap.xml`,
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`_
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