Installations
npm install gatsby-plugin-advanced-sitemap
Releases
Unable to fetch releases
Developer
tryghost
Developer Guide
Module System
CommonJS
Min. Node Version
>= 12.19.0
Typescript Support
No
Node Version
NPM Version
Statistics
150 Stars
313 Commits
11 Watching
2 Branches
47 Contributors
Updated on 25 Jul 2024
Bundle Size
142.00 B
Minified
129.00 B
Minified + Gzipped
Languages
JavaScript (84.39%)
XSLT (15.61%)
Total Downloads
Cumulative downloads
Total Downloads
4,781,548
Last day
-6.8%
1,658
Compared to previous day
Last week
5.3%
10,703
Compared to previous week
Last month
2.9%
43,729
Compared to previous month
Last year
-30.5%
850,921
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
gatsby-plugin-advanced-sitemap
The default Gatsby sitemap plugin generates a simple blob of raw XML for all your pages. This advanced sitemap plugin adds more power and configuration, generating a single or multiple sitemaps with full XSL templates to make them neatly organised and human + machine readable, as well linking image resources to encourage media indexing.
Demo: https://gatsby.ghost.org/sitemap.xml
NOTE: This plugin only generates output in production
mode! To test, run: gatsby build && gatsby serve
Install
npm install --save gatsby-plugin-advanced-sitemap
How to Use
By default this plugin will generate a single sitemap of all pages on your site, without any configuration needed.
1// gatsby-config.js 2 3siteMetadata: { 4 siteUrl: `https://www.example.com`, 5}, 6plugins: [ 7 `gatsby-plugin-advanced-sitemap` 8]
Options
If you want to generate advanced, individually organised sitemaps based on your data, you can do so by passing in a query and config. The example below uses Ghost, but this should work with any data source - including Pages, Markdown, Contentful, etc.
Example:
1// gatsby-config.js 2 3plugins: [ 4 { 5 resolve: `gatsby-plugin-advanced-sitemap`, 6 options: { 7 // 1 query for each data type 8 query: ` 9 { 10 allGhostPost { 11 edges { 12 node { 13 id 14 slug 15 updated_at 16 feature_image 17 } 18 } 19 } 20 allGhostPage { 21 edges { 22 node { 23 id 24 slug 25 updated_at 26 feature_image 27 } 28 } 29 } 30 allGhostTag { 31 edges { 32 node { 33 id 34 slug 35 feature_image 36 } 37 } 38 } 39 allGhostAuthor { 40 edges { 41 node { 42 id 43 slug 44 profile_image 45 } 46 } 47 } 48 }`, 49 // The filepath and name to Index Sitemap. Defaults to '/sitemap.xml'. 50 output: "/custom-sitemap.xml", 51 mapping: { 52 // Each data type can be mapped to a predefined sitemap 53 // Routes can be grouped in one of: posts, tags, authors, pages, or a custom name 54 // The default sitemap - if none is passed - will be pages 55 allGhostPost: { 56 sitemap: `posts`, 57 // Add a query level prefix to slugs, Don't get confused with global path prefix from Gatsby 58 // This will add a prefix to this particular sitemap only 59 prefix: 'your-prefix/', 60 // Custom Serializer 61 serializer: (edges) => { 62 return edges.map(({ node }) => { 63 (...) // Custom logic to change final sitemap. 64 }) 65 } 66 }, 67 allGhostTag: { 68 sitemap: `tags`, 69 }, 70 allGhostAuthor: { 71 sitemap: `authors`, 72 }, 73 allGhostPage: { 74 sitemap: `pages`, 75 }, 76 }, 77 exclude: [ 78 `/dev-404-page`, 79 `/404`, 80 `/404.html`, 81 `/offline-plugin-app-shell-fallback`, 82 `/my-excluded-page`, 83 /(\/)?hash-\S*/, // you can also pass valid RegExp to exclude internal tags for example 84 ], 85 createLinkInHead: true, // optional: create a link in the `<head>` of your site 86 addUncaughtPages: true, // optional: will fill up pages that are not caught by queries and mapping and list them under `sitemap-pages.xml` 87 additionalSitemaps: [ // optional: add additional sitemaps, which are e. g. generated somewhere else, but need to be indexed for this domain 88 { 89 name: `my-other-posts`, 90 url: `/blog/sitemap-posts.xml`, 91 }, 92 { 93 url: `https://example.com/sitemap.xml`, 94 }, 95 ], 96 } 97 } 98]
Example output of ☝️ this exact config 👉 https://gatsby.ghost.org/sitemap.xml
Develop Plugin
- Pull the repo
- Install dependencies
1yarn install
Build Plugin
1yarn build
Run Tests
1yarn test
Copyright & License
Copyright (c) 2013-2023 Ghost Foundation - Released under the MIT license.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
security policy file detected
Details
- Info: security policy file detected: github.com/TryGhost/.github/SECURITY.md:1
- Info: Found linked content: github.com/TryGhost/.github/SECURITY.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: github.com/TryGhost/.github/SECURITY.md:1
- Info: Found text in security policy: github.com/TryGhost/.github/SECURITY.md:1
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/test.yml:1
- Info: no jobLevel write permissions found
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/TryGhost/gatsby-plugin-advanced-sitemap/test.yml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/test.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/TryGhost/gatsby-plugin-advanced-sitemap/test.yml/main?enable=pin
- Info: 0 out of 2 GitHub-owned GitHubAction dependencies pinned
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 29 are checked with a SAST tool
Reason
54 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-whgm-jr23-g3j9
- Warn: Project is vulnerable to: GHSA-wf5p-g6vw-rhxx
- Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5
- Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x
- Warn: Project is vulnerable to: GHSA-7gc6-qh9x-w6h8
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-wm7h-9275-46v2
- Warn: Project is vulnerable to: GHSA-r7qp-cfhv-p84w
- Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc
- Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx
- Warn: Project is vulnerable to: GHSA-cxjh-pqwp-8mfp
- Warn: Project is vulnerable to: GHSA-c6f8-8r25-c4gc
- Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97
- Warn: Project is vulnerable to: GHSA-rc47-6667-2j5j
- Warn: Project is vulnerable to: GHSA-c7qv-q95q-8v27
- Warn: Project is vulnerable to: GHSA-33f9-j839-rf8h
- Warn: Project is vulnerable to: GHSA-c36v-fmgq-m8hx
- Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488
- Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-8hfj-j24r-96c4
- Warn: Project is vulnerable to: GHSA-wc69-rhjr-hc9g
- Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g
- Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5
- Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp
- Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq
- Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr
- Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765
- Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g
- Warn: Project is vulnerable to: GHSA-v39p-96qg-c8rf
- Warn: Project is vulnerable to: GHSA-8v63-cqqc-6r2c
- Warn: Project is vulnerable to: GHSA-3j8f-xvm3-ffx4
- Warn: Project is vulnerable to: GHSA-j9fq-vwqv-2fm2
- Warn: Project is vulnerable to: GHSA-pqw5-jmp5-px4v
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-hwj9-h5mp-3pm3
- Warn: Project is vulnerable to: GHSA-566m-qj78-rww5
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg
- Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p
- Warn: Project is vulnerable to: GHSA-g4rg-993r-mgx7
- Warn: Project is vulnerable to: GHSA-25hc-qcg6-38wj
- Warn: Project is vulnerable to: GHSA-cqmj-92xf-r6r9
- Warn: Project is vulnerable to: GHSA-w5p7-h5w8-2hfq
- Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986
- Warn: Project is vulnerable to: GHSA-wr3j-pwj9-hqq6
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-6fc8-4gx4-v693
Score
3.4
/10
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to gatsby-plugin-advanced-sitemap
gatsby-plugin-advanced-sitemap-patch
Advanced plugin for generating configurable XML sitemaps with linked media for better SEO and human-readable XSL templates.
gatsby-plugin-sitemap
Gatsby plugin that automatically creates a sitemap for your site
gatsby-plugin-advanced-sitemap-v5
Advanced plugin for generating configurable XML sitemaps with linked media for better SEO and human-readable XSL templates.
gatsby-plugin-robots-txt
Gatsby plugin that automatically creates robots.txt for your site