{"_id":"@auratiger/gatsby-plugin-advanced-sitemap-reworked","name":"@auratiger/gatsby-plugin-advanced-sitemap-reworked","dist-tags":{"latest":"2.1.0"},"versions":{"2.1.0":{"name":"@auratiger/gatsby-plugin-advanced-sitemap-reworked","description":"Advanced plugin for generating configurable XML sitemaps with linked media for better SEO and human-readable XSL templates.","version":"2.1.0","license":"MIT","author":{"name":"auratiger"},"repository":{"type":"git","url":"https://github.com/auratiger/gatsby-plugin-advanced-sitemap.git"},"engines":{"node":">= 12.19.0"},"bugs":{"url":"https://github.com/auratiger/gatsby-plugin-advanced-sitemap/issues"},"main":"index.js","keywords":["gatsby","gatsby-plugin"],"scripts":{"lint":"eslint --ext .js -c .eslintrc.js --cache src/**","test":"jest .","build":"babel src --out-dir . --ignore **/__tests__","prepare":"cross-env NODE_ENV=production yarn build","watch":"babel -w src --out-dir . --ignore **/__tests__","ship":"STATUS=$(git status --porcelain); echo $STATUS; if [ -z \"$STATUS\" ]; then yarn publish && git push --follow-tags; fi"},"peerDependencies":{"gatsby":"^3.0.0 || ^4.0.0"},"devDependencies":{"@babel/cli":"7.14.3","@babel/core":"7.14.3","babel-eslint":"10.1.0","babel-jest":"26.6.3","babel-preset-gatsby-package":"1.5.0","cross-env":"7.0.3","eslint":"7.30.0","eslint-plugin-ghost":"2.5.0","eslint-plugin-jest":"24.3.6","eslint-plugin-react":"7.24.0","gatsby":"3.5.0","jest":"26.6.3","react":"17.0.2","react-dom":"17.0.2"},"dependencies":{"@babel/runtime":"7.14.0","fs-extra":"10.1.0","lodash":"4.17.21","moment":"2.29.1","pify":"5.0.0","xml":"^1.0.1"},"licenseText":"MIT License\n\nCopyright (c) 2013-2022 Ghost Foundation\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n","_id":"@auratiger/gatsby-plugin-advanced-sitemap-reworked@2.1.0","dist":{"shasum":"359a4205481ac1ee7328dbb00c2c324e1ece5c21","integrity":"sha512-5tNjMxuz8vbjysAvi4gPH8SffVqSvKnFzlWQ1SdxKWPElfarwK1Lo7MV/6X2soNlvjOfT6xuwU1uAqo6FmHN8g==","tarball":"https://registry.npmjs.org/@auratiger/gatsby-plugin-advanced-sitemap-reworked/-/gatsby-plugin-advanced-sitemap-reworked-2.1.0.tgz","fileCount":55,"unpackedSize":94753,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCRxKXuxRou5I9/Ah0dtkamWQR11FoA2BDpus+aAG/I6QIhALJVk0QS9n6dHiA+j5U0mpHQs5IenLjexa+OH+MkGEi4"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIMWNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpq8A//VimkdytGZM9pmkST9kzULxF3PM8S3E7wrBDJaocJ848Ryfeq\r\nWp25WJnHm4Hu+utBDXK9XJZEk5B3b62t+5TNvf5Xn6mytjYSYA/z/jpq2f+F\r\nhDa5aqBl4cMX2ztL1pIB8IbrwBfgdww5TdmmXZf8vjnkkL+yYnX8AaHSooSg\r\nmt09a57w0TGBaM93nY4iJtEvtFGqQpu73MMkgvDi/0PWKC6466KxdUAO3SIP\r\nTGo6PI5d99oCVuzbcnoWQ9SIm3H4mlW+YwlogQyQb5T/mFtkUibDazG3VROR\r\nkRdYogBrYuQIckkHNJIzZa6UXwBMtihEP89UFd+X2JybmB9IL2A4YdjfpQVj\r\n1niQKholamLp/iBW1FssXmHEmzWOoG9kIdJrlvj5Ux/mDvi+yZGKZEQzOSzr\r\n6h4EyAt+efWb5VD0i4uNc/IX0Qbm22a38xs0M1W3aMwc78cZ+64lB2U8ZUnv\r\nHtKZ5juwOdcLBoKaKx0DsS4aojByyR/9qV13MCKsHoQOfm/tyvapZ5WU4AMb\r\nTCMAjmwNuUmRe6RUqmnVIoL5vBY58br68dU8WCDIeSq/hf0A0JtUklMhahL7\r\nBeBUP2VmFAyhux87lDO6HHWjYETwl2y/4RjelzY304qIBBNmAxVM26nF4H+A\r\nZfLzKrkXuxqH+z5i3Bu7qWH5ELo+OIBFTh0=\r\n=3Xib\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"auratiger","email":"auratiger00@gmail.com"},"directories":{},"maintainers":[{"name":"auratiger","email":"auratiger00@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gatsby-plugin-advanced-sitemap-reworked_2.1.0_1663092109326_0.32857555900361657"},"_hasShrinkwrap":false}},"time":{"created":"2022-09-13T18:01:49.266Z","2.1.0":"2022-09-13T18:01:49.506Z","modified":"2022-09-13T18:01:49.700Z"},"maintainers":[{"name":"auratiger","email":"auratiger00@gmail.com"}],"description":"Advanced plugin for generating configurable XML sitemaps with linked media for better SEO and human-readable XSL templates.","keywords":["gatsby","gatsby-plugin"],"repository":{"type":"git","url":"https://github.com/auratiger/gatsby-plugin-advanced-sitemap.git"},"author":{"name":"auratiger"},"bugs":{"url":"https://github.com/auratiger/gatsby-plugin-advanced-sitemap/issues"},"license":"MIT","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 organized and human + machine readable, as well linking image resources to encourage media indexing.\n\n&nbsp;\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 && gatsby serve`_\n\n&nbsp;\n\n## Install\n\n`npm install --save @auratiger/gatsby-plugin-advanced-sitemap-reworked`\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    `@auratiger/gatsby-plugin-advanced-sitemap-reworked`\n]\n```\n\n&nbsp;\n\n## Options\n\nIf you want to generate advanced, individually organized 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: `@auratiger/gatsby-plugin-advanced-sitemap-reworked`,\n        options: {\n             // 1 query for each data type\n            query: `\n            {\n                posts: allSitePage(filter: {path: {regex: \"//posts.*/\"}}) {\n                    edges {\n                        node {\n                            id\n                            slug: path\n                            url: path\n                            pageContext\n                        }\n                    }\n                }\n                categories: allSitePage(filter: {path: {regex: \"//categories.*/\"}}) {\n                    edges {\n                        node {\n                            id\n                            slug: path\n                            url: path\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                posts: {\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: any) => {\n                        return edges.map(({ node }: any) => {\n                            return {\n                                node: {\n                                    id: node.id,\n                                    slug: node.slug,\n                                    url: node.url,\n                                    updated_at: node?.pageContext?.date, // updated_at || published_at || created_at\n                                    cover_image: node?.pageContext?.image, // cover_image || profile_image || feature_image;\n                                },\n                            }\n                        })\n                    },\n                },\n                categories: {\n                    sitemap: `categories`,\n                    serializer: (edges: any) => {\n                        return edges.map(({ node }: any) => {\n                            return {\n                                node: {\n                                    id: node.id,\n                                    slug: node.slug,\n                                    url: node.url,\n                                },\n                            }\n                        })\n                    },\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 `<head>` 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## API Reference\n\n## serialize ⇒ <code>object</code>\n\nreceives: object[] - - Array of objects representing each page\n\n| Param | Type                | Description                                               |\n|-------|---------------------|-----------------------------------------------------------|\n| edges | <code>object</code> | this function receives the result of the executed queries |\n\nReturns: object[] - - Array of objects containing the data needed to generate the sitemap urls\n\n| Return Object                               | Type                  | Description                                                          |\n|---------------------------------------------|-----------------------|----------------------------------------------------------------------|\n| id                                          | <code>string</code>   | page path                                                            |\n| url                                         | <code>string</code>   | page path                                                            |\n| slug                                        | <code>string</code>   | page path                                                            |\n| updated_at / published_at / created_at      | <code>string</code>   | Optional: string representing when last the page was updated         |\n| cover_image / profile_image / feature_image | <code>object</code>   | Optional: object representing a single image                         |\n| pageImages                                  | <code>object[]</code> | Optional: Array containing multiple images to be linked for the page |\n\n| Image Object | Type                | Description                                                  |\n|--------------|---------------------|--------------------------------------------------------------|\n| path         | <code>string</code> | image path                                                   |\n| caption      | <code>string</code> | Optional: caption describing the image, similar to alt tags. |\n\n&nbsp;\n","readmeFilename":"README.md"}