{"id":22489424,"url":"https://github.com/L422Y/nuxt-mapple","last_synced_at":"2025-08-02T21:32:48.600Z","repository":{"id":63944312,"uuid":"571958760","full_name":"L422Y/nuxt-mapple","owner":"L422Y","description":"Nuxt module to build `/sitemap.xml` using a combination of static and generated routes.","archived":false,"fork":false,"pushed_at":"2024-01-23T10:23:45.000Z","size":139,"stargazers_count":9,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-11-21T23:05:12.132Z","etag":null,"topics":["javascript","module","nuxt","nuxtjs","seo","seo-op","sitemap","typescript","vue","xml"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/L422Y.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2022-11-29T08:59:51.000Z","updated_at":"2023-10-14T18:09:16.000Z","dependencies_parsed_at":"2024-01-06T16:42:58.966Z","dependency_job_id":"1d03ebe0-04a1-4b21-be2e-361bc75e480a","html_url":"https://github.com/L422Y/nuxt-mapple","commit_stats":{"total_commits":8,"total_committers":1,"mean_commits":8.0,"dds":0.0,"last_synced_commit":"9158d9181b957df69d4a76f8d25d873ece8dab2b"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/L422Y%2Fnuxt-mapple","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/L422Y%2Fnuxt-mapple/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/L422Y%2Fnuxt-mapple/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/L422Y%2Fnuxt-mapple/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/L422Y","download_url":"https://codeload.github.com/L422Y/nuxt-mapple/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228500226,"owners_count":17930020,"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":["javascript","module","nuxt","nuxtjs","seo","seo-op","sitemap","typescript","vue","xml"],"created_at":"2024-12-06T17:19:50.712Z","updated_at":"2024-12-06T17:22:13.984Z","avatar_url":"https://github.com/L422Y.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Nuxt: Mapple - A Sitemap Generator\n\n![npm](https://img.shields.io/npm/dt/nuxt-mapple)\n\nThis module will build and put a sitemap at `/sitemap.xml` using a combination of optional static, dynamic, and\ngenerated routes. All pages without parameters in their paths will be inserted automatically (i.e. `pages/blog.vue`),\nand when `useContent` is enabled, the `content` folder is scanned for `.md` files, and added to the sitemap.\n\n# Installation\n\n`yarn add nuxt-mapple`\n\nAdd the module to your `nuxt.config.ts`:\n`modules: ['nuxt-mapple'],`\n\n# Usage\n\n### Exclude content with a Regular Expression\n\nYou can exclude paths (as well as separately/specifically content paths) from the sitemap by using a Regular Expression (with leading and trailing slashes):\n\n```ts\ndefineNuxtConfig({\n  mapple: {\n    excludeAny: \"(/early-signup|/u/*)\",\n    excludeContent: \"^/(references/).*\",\n  }\n})\n```\n\n### Static Paths\n\nYou can list static paths manually in your `nuxt.config.ts`, in an array of relative paths:\n\n```js\ndefineNuxtConfig({\n  mapple: {\n    basePath: 'https://l422y.com',\n    static: [\n      '/projects/mtv/the-buried-life-storefront',\n      '/projects/travelers/umbrella-hall',\n      '/projects/mayo-clinic/mayo-clinic-memory-game',\n      '/projects/f4w/tactica',\n    ]\n  }\n})\n```\n\n### Content Directory\n\nor enable scanning of your `content` folder for `.md` files by enabling `useContent` and, optionally, including a filter\nfor paths to exclude (example below will exclude `/references/*`):\n\n```js\ndefineNuxtConfig({\n  mapple: {\n    basePath: 'https://l422y.com',\n    useContent: true,\n    excludeContent: \"^/(references/).*\", // Regular Expression (with leading and trailing slashes)\n  }\n})\n```\n\n### Build using templates and datasets\n\n... or you can build based on route templates and datasets, using multi-dimensional arrays, i.e. a route template\nof `/@/@` and a dataset like the following:\n\n```js\n[\n  ['blog', ['post-a', 'post-b', 'post-c']],\n  ['projects', ['project-1', 'project-2', 'project-3']]\n]\n```\n\nOur configuration would look something like this:\n\n```js\ndefineNuxtConfig({\n  modules: ['nuxt-mapple'],\n  mapple: {\n    basePath: 'https://l422y.com',\n    staticRoutes: ['/'],\n    dynamicRoutes: [\n      {\n        route: '/@/@',\n        data: [\n          ['blog', ['post-a', 'post-b', 'post-c']],\n          ['projects', ['project-1', 'project-2', 'project-3']]\n        ]\n      }\n    ]\n  }\n})\n```\n\nOur `sitemap.xml` will look like this:\n\n```xml\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\n\u003curlset xmlns=\"https://www.sitemaps.org/schemas/sitemap/0.9\"\u003e\n  \u003curl\u003e\n    \u003cloc\u003ehttps://l422y.com/blog/post-a\u003c/loc\u003e\n  \u003c/url\u003e\n  \u003curl\u003e\n    \u003cloc\u003ehttps://l422y.com/blog/post-b\u003c/loc\u003e\n  \u003c/url\u003e\n  \u003curl\u003e\n    \u003cloc\u003ehttps://l422y.com/blog/post-c\u003c/loc\u003e\n  \u003c/url\u003e\n  \u003curl\u003e\n    \u003cloc\u003ehttps://l422y.com/projects/project-1\u003c/loc\u003e\n  \u003c/url\u003e\n  \u003curl\u003e\n    \u003cloc\u003ehttps://l422y.com/projects/project-2\u003c/loc\u003e\n  \u003c/url\u003e\n  \u003curl\u003e\n    \u003cloc\u003ehttps://l422y.com/projects/project-3\u003c/loc\u003e\n  \u003c/url\u003e\n  \u003curl\u003e\n    \u003cloc\u003ehttps://l422y.com/\u003c/loc\u003e\n  \u003c/url\u003e\n\u003c/urlset\u003e\n```\n\n##\n\nHere's a full configuration example:\n\n```js\ndefineNuxtConfig({\n  mapple: {\n    basePath: 'https://l422y.com',\n    dynamic: [\n      {\n        // single depth route template\n        route: '/projects/@',\n        // single depth dataset\n        data: [\n          'personal/musicmonitor',\n          'disney/photo-video-kiosk',\n        ]\n      },\n      {\n        // double depth route template\n        route: '/projects/@/@',\n        // double depth dataset\n        data: [\n          ['personal',\n            [\n              'whatcd-releases-tracker',\n              'music-shop-aggregator'\n            ]\n          ],\n          ['monstermedia',\n            [\n              'flash-analytics',\n              'monitoring-control-system',\n              'hbo-unwrap',\n            ]\n          ],\n        ]\n      },\n      {\n        // single depth route template\n        route: '/blog/@',\n        // single depth dataset\n        data: [\n          'nuxt-adventures-1',\n          'nuxt-adventures-2',\n          'nuxt3-dynamic-social-images',\n          'web3-endpoint-cycler',\n          'wordpress-paywall',\n        ]\n      },\n      {\n        // single depth route template\n        route: '/@',\n        // single depth dataset\n        data: [\n          'projects',\n          'experience',\n          'skills',\n          'references',\n          'blog',\n          'about'\n        ]\n      }\n    ]\n\n  }\n})\n```\n\n## Development\n\n- Run `npm run dev:prepare` to generate type stubs.\n\n## Credits\n\nMade with 💚 by [Larry Williamson](https://l422y.com) / [@l422y](https://twitter.com/l422y)\n\nOriginally ideated from @benoitdemaegdt's [nuxt3-sitemap](https://github.com/benoitdemaegdt/nuxt3-sitemap)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FL422Y%2Fnuxt-mapple","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FL422Y%2Fnuxt-mapple","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FL422Y%2Fnuxt-mapple/lists"}