{"id":13725585,"url":"https://github.com/TryGhost/gatsby-plugin-advanced-sitemap","last_synced_at":"2025-05-07T20:32:55.148Z","repository":{"id":34239187,"uuid":"172428251","full_name":"TryGhost/gatsby-plugin-advanced-sitemap","owner":"TryGhost","description":"Advanced XML Sitemaps for Gatsby.js","archived":false,"fork":true,"pushed_at":"2025-01-07T14:05:40.000Z","size":2613,"stargazers_count":150,"open_issues_count":21,"forks_count":0,"subscribers_count":10,"default_branch":"main","last_synced_at":"2025-05-03T21:27:02.671Z","etag":null,"topics":["gatsby","gatsby-plugin","gatsbyjs","seo","sitemap-generator","static-site"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"taboola/gatsby-plugin-advanced-sitemap","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TryGhost.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null},"funding":{"github":"tryghost","open_collective":"ghost"}},"created_at":"2019-02-25T03:32:29.000Z","updated_at":"2025-04-04T03:42:40.000Z","dependencies_parsed_at":"2023-09-25T13:34:27.581Z","dependency_job_id":"1d1f833c-c355-4f10-b3ad-d63028a13d78","html_url":"https://github.com/TryGhost/gatsby-plugin-advanced-sitemap","commit_stats":{"total_commits":310,"total_committers":19,"mean_commits":16.31578947368421,"dds":0.5580645161290323,"last_synced_commit":"18560ed1d5c8f1351317fe2a493dac9173ec0790"},"previous_names":[],"tags_count":28,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TryGhost%2Fgatsby-plugin-advanced-sitemap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TryGhost%2Fgatsby-plugin-advanced-sitemap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TryGhost%2Fgatsby-plugin-advanced-sitemap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TryGhost%2Fgatsby-plugin-advanced-sitemap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TryGhost","download_url":"https://codeload.github.com/TryGhost/gatsby-plugin-advanced-sitemap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252953716,"owners_count":21830890,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gatsby","gatsby-plugin","gatsbyjs","seo","sitemap-generator","static-site"],"created_at":"2024-08-03T01:02:28.175Z","updated_at":"2025-05-07T20:32:55.128Z","avatar_url":"https://github.com/TryGhost.png","language":"JavaScript","funding_links":["https://github.com/sponsors/tryghost","https://opencollective.com/ghost"],"categories":["JavaScript"],"sub_categories":[],"readme":"# gatsby-plugin-advanced-sitemap\n\nThe 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.\n\n**Demo:** https://gatsby.ghost.org/sitemap.xml\n\n\n\u0026nbsp;\n\n![example](https://user-images.githubusercontent.com/120485/53555088-d27a0280-3b73-11e9-88ca-fb4ec08d9d26.png)\n\n_NOTE: This plugin only generates output in `production` mode! To test, run: `gatsby build \u0026\u0026 gatsby serve`_\n\n\u0026nbsp;\n\n\n## Install\n\n`npm install --save gatsby-plugin-advanced-sitemap`\n\n## How to Use\n\nBy default this plugin will generate a single sitemap of all pages on your site, without any configuration needed.\n\n```javascript\n// gatsby-config.js\n\nsiteMetadata: {\n    siteUrl: `https://www.example.com`,\n},\nplugins: [\n    `gatsby-plugin-advanced-sitemap`\n]\n```\n\n\u0026nbsp;\n\n## Options\n\nIf 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](https://ghost.org/), but this should work with any data source - including Pages, Markdown, Contentful, etc.\n\n**Example:**\n\n```javascript\n// gatsby-config.js\n\nplugins: [\n    {\n        resolve: `gatsby-plugin-advanced-sitemap`,\n        options: {\n             // 1 query for each data type\n            query: `\n            {\n                allGhostPost {\n                    edges {\n                        node {\n                            id\n                            slug\n                            updated_at\n                            feature_image\n                        }\n                    }\n                }\n                allGhostPage {\n                    edges {\n                        node {\n                            id\n                            slug\n                            updated_at\n                            feature_image\n                        }\n                    }\n                }\n                allGhostTag {\n                    edges {\n                        node {\n                            id\n                            slug\n                            feature_image\n                        }\n                    }\n                }\n                allGhostAuthor {\n                    edges {\n                        node {\n                            id\n                            slug\n                            profile_image\n                        }\n                    }\n                }\n            }`,\n            // The filepath and name to Index Sitemap. Defaults to '/sitemap.xml'.\n            output: \"/custom-sitemap.xml\",\n            mapping: {\n                // Each data type can be mapped to a predefined sitemap\n                // Routes can be grouped in one of: posts, tags, authors, pages, or a custom name\n                // The default sitemap - if none is passed - will be pages\n                allGhostPost: {\n                    sitemap: `posts`,\n                    // Add a query level prefix to slugs, Don't get confused with global path prefix from Gatsby\n                    // This will add a prefix to this particular sitemap only\n                    prefix: 'your-prefix/',\n                    // Custom Serializer \n                    serializer: (edges) =\u003e {\n                        return edges.map(({ node }) =\u003e {\n                            (...) // Custom logic to change final sitemap.\n                        })\n                    }\n                },\n                allGhostTag: {\n                    sitemap: `tags`,\n                },\n                allGhostAuthor: {\n                    sitemap: `authors`,\n                },\n                allGhostPage: {\n                    sitemap: `pages`,\n                },\n            },\n            exclude: [\n                `/dev-404-page`,\n                `/404`,\n                `/404.html`,\n                `/offline-plugin-app-shell-fallback`,\n                `/my-excluded-page`,\n                /(\\/)?hash-\\S*/, // you can also pass valid RegExp to exclude internal tags for example\n            ],\n            createLinkInHead: true, // optional: create a link in the `\u003chead\u003e` of your site\n            addUncaughtPages: true, // optional: will fill up pages that are not caught by queries and mapping and list them under `sitemap-pages.xml`\n            additionalSitemaps: [ // optional: add additional sitemaps, which are e. g. generated somewhere else, but need to be indexed for this domain\n                {\n                    name: `my-other-posts`,\n                    url: `/blog/sitemap-posts.xml`,\n                },\n                {\n                    url: `https://example.com/sitemap.xml`,\n                },\n            ],\n        }\n    }\n]\n```\n\nExample output of ☝️ this exact config 👉 https://gatsby.ghost.org/sitemap.xml\n\n## Develop Plugin\n\n- Pull the repo\n\n1. Install dependencies\n\n```bash\nyarn install\n```\n\nBuild Plugin\n\n```bash\nyarn build\n```\n\nRun Tests\n\n```bash\nyarn test\n```\n\n\u0026nbsp;\n\n# Copyright \u0026 License\n\nCopyright (c) 2013-2025 [Ghost Foundation](https://ghost.org/) - Released under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTryGhost%2Fgatsby-plugin-advanced-sitemap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FTryGhost%2Fgatsby-plugin-advanced-sitemap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FTryGhost%2Fgatsby-plugin-advanced-sitemap/lists"}