{"id":14962595,"url":"https://github.com/bartholomej/svelte-sitemap","last_synced_at":"2026-04-10T10:03:41.170Z","repository":{"id":37730325,"uuid":"375370973","full_name":"bartholomej/svelte-sitemap","owner":"bartholomej","description":"Sitemap generator for SvelteKit. Small helper which scans your SvelteKit routes and generates static sitemap.xml","archived":false,"fork":false,"pushed_at":"2026-04-07T17:55:46.000Z","size":5156,"stargazers_count":342,"open_issues_count":13,"forks_count":10,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-04-07T19:27:09.840Z","etag":null,"topics":["cli","generator","javascript","router","sitemap-generator","sitemap-xml","static-adapter","svelte","svelte-library","sveltejs","sveltekit","typescript","typescript-library"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bartholomej.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["bartholomej"],"patreon":null,"open_collective":null,"ko_fi":"bartholomej","buy_me_a_coffee":"bartholomej","thanks_dev":"u/gh/bartholomej","tidelift":null,"custom":["https://www.paypal.me/bartholomej"]}},"created_at":"2021-06-09T13:47:06.000Z","updated_at":"2026-04-04T08:05:24.000Z","dependencies_parsed_at":"2024-06-19T05:30:23.996Z","dependency_job_id":"495fc624-9977-4835-8f07-de2d3fbf1fa1","html_url":"https://github.com/bartholomej/svelte-sitemap","commit_stats":{"total_commits":131,"total_committers":7,"mean_commits":"18.714285714285715","dds":0.05343511450381677,"last_synced_commit":"cb8e4c71d99f516a412cc566f957758205df00d4"},"previous_names":[],"tags_count":36,"template":false,"template_full_name":null,"purl":"pkg:github/bartholomej/svelte-sitemap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartholomej%2Fsvelte-sitemap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartholomej%2Fsvelte-sitemap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartholomej%2Fsvelte-sitemap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartholomej%2Fsvelte-sitemap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bartholomej","download_url":"https://codeload.github.com/bartholomej/svelte-sitemap/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bartholomej%2Fsvelte-sitemap/sbom","scorecard":{"id":226311,"data":{"date":"2025-08-11","repo":{"name":"github.com/bartholomej/svelte-sitemap","commit":"1f8f0932d34319e16c195e5fb5efe2d27e457da6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.7,"checks":[{"name":"Maintained","score":1,"reason":"2 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":1,"reason":"Found 3/16 approved changesets -- score normalized to 1","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/bartholomej/svelte-sitemap/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/bartholomej/svelte-sitemap/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/main.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/bartholomej/svelte-sitemap/main.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/bartholomej/svelte-sitemap/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/bartholomej/svelte-sitemap/publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yml:21: update your workflow using https://app.stepsecurity.io/secureworkflow/bartholomej/svelte-sitemap/publish.yml/master?enable=pin","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/main.yml:1","Warn: no topLevel permission defined: .github/workflows/publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/publish.yml:9"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 21 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":3,"reason":"7 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-968p-4wvh-cqc8","Warn: Project is vulnerable to: GHSA-xffm-g5w8-qvg7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-17T03:53:36.240Z","repository_id":37730325,"created_at":"2025-08-17T03:53:36.240Z","updated_at":"2025-08-17T03:53:36.240Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31637749,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-10T07:40:12.752Z","status":"ssl_error","status_checked_at":"2026-04-10T07:40:11.664Z","response_time":98,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["cli","generator","javascript","router","sitemap-generator","sitemap-xml","static-adapter","svelte","svelte-library","sveltejs","sveltekit","typescript","typescript-library"],"created_at":"2024-09-24T13:30:07.116Z","updated_at":"2026-04-10T10:03:41.164Z","avatar_url":"https://github.com/bartholomej.png","language":"TypeScript","funding_links":["https://github.com/sponsors/bartholomej","https://ko-fi.com/bartholomej","https://buymeacoffee.com/bartholomej","https://thanks.dev/u/gh/bartholomej","https://www.paypal.me/bartholomej"],"categories":[],"sub_categories":[],"readme":"[![npm version](https://badge.fury.io/js/svelte-sitemap.svg)](https://badge.fury.io/js/svelte-sitemap)\n[![Package License](https://img.shields.io/npm/l/svelte-sitemap.svg)](https://www.npmjs.com/svelte-sitemap)\n[![Build \u0026 Publish](https://github.com/bartholomej/svelte-sitemap/workflows/Build%20\u0026%20Publish/badge.svg)](https://github.com/bartholomej/svelte-sitemap/actions)\n\n# 🗺️ Svelte `sitemap.xml` generator\n\n**Generates `sitemap.xml` from your SvelteKit static routes — automatically, on every build.**\n\n---\n\n- ➡️ Designed for SvelteKit `adapter-static` with `prerender` option (SSG)\n- 🔷 TypeScript, JavaScript, CLI version\n- 🔧 Useful [options](#%EF%B8%8F-options) for customizing your sitemap\n- 📡 [Ping](#-ping-google-search-console) Google Search Console after deploy\n- 🗂️ Support for [sitemap index](https://developers.google.com/search/docs/crawling-indexing/sitemaps/large-sitemaps) for large sites (50K+ pages)\n- ▲ 🟠 Works with [Vercel](#-vercel-adapter) and [Cloudflare](#-cloudflare-adapter) adapters and more...\n\n## 📦 Install\n\n```bash\nnpm install svelte-sitemap --save-dev\n# yarn add svelte-sitemap --dev\n# pnpm add -D svelte-sitemap\n# bun add -d svelte-sitemap\n```\n\n## 🚀 Usage\n\n\u003e There are three ways to use this library. Pick the one that suits you best.\n\n### ✨ Method 1: Config file (recommended)\n\nCreate a config file `svelte-sitemap.config.ts` in the root of your project:\n\n```typescript\n// svelte-sitemap.config.ts\nimport type { OptionsSvelteSitemap } from 'svelte-sitemap';\n\nconst config: OptionsSvelteSitemap = {\n  domain: 'https://www.example.com',\n  trailingSlashes: true\n  // ...more options below\n};\n\nexport default config;\n```\n\nThen add `svelte-sitemap` as a `postbuild` script in `package.json`:\n\n```json\n{\n  \"scripts\": {\n    \"postbuild\": \"npx svelte-sitemap\"\n  }\n}\n```\n\nThat's it. After every `build`, the sitemap is automatically generated in your `build/` folder.\n\n---\n\n### ⌨️ Method 2: CLI (legacy)\n\nPass options directly as CLI flags — no config file needed:\n\n```json\n{\n  \"scripts\": {\n    \"postbuild\": \"npx svelte-sitemap --domain https://myawesomedomain.com\"\n  }\n}\n```\n\nSee all available flags in the [Options](#%EF%B8%8F-options) table below.\n\n---\n\n### 🔧 Method 3: JavaScript / TypeScript API\n\nSometimes it's useful to call the script directly from code:\n\n```typescript\n// my-script.js\nimport { createSitemap } from 'svelte-sitemap';\n\ncreateSitemap({ domain: 'https://example.com', debug: true });\n```\n\nRun your script:\n\n```bash\nnode my-script.js\n```\n\n---\n\n## ⚙️ Options\n\nOptions are defined as **config file keys** (camelCase). Use it in your `svelte-sitemap.config.ts` file.\n_The same options are also available as **CLI flags** for legacy use._\n\n| Config key        | CLI flag                   | Description                                                                                                         | Default | Example                                     |\n| ----------------- | -------------------------- | ------------------------------------------------------------------------------------------------------------------- | ------- | ------------------------------------------- |\n| `domain`          | `--domain`, `-d`           | Your domain **[required]**                                                                                          | -       | `domain: 'https://mydomain.com'`            |\n| `outDir`          | `--out-dir`, `-o`          | Custom build folder                                                                                                 | `build` | `outDir: 'dist'`                            |\n| `additional`      | `--additional`, `-a`       | Additional pages outside of SvelteKit                                                                               | -       | `additional: ['my-page', 'my-second-page']` |\n| `ignore`          | `--ignore`, `-i`           | Ignore files or folders (glob patterns)                                                                             | `[]`    | `ignore: ['**/admin/**', 'my-secret-page']` |\n| `trailingSlashes` | `--trailing-slashes`, `-t` | Add trailing slashes                                                                                                | `false` | `trailingSlashes: true`                     |\n| `resetTime`       | `--reset-time`, `-r`       | Set lastModified time to now                                                                                        | `false` | `resetTime: true`                           |\n| `changeFreq`      | `--change-freq`, `-c`      | Set change frequency [options](https://github.com/bartholomej/svelte-sitemap/blob/master/src/dto/global.dto.ts#L23) | -       | `changeFreq: 'daily'`                       |\n| `debug`           | `--debug`                  | Show some useful logs                                                                                               | -       | `debug: true`                               |\n| -                 | `--help`, `-h`             | Display usage info                                                                                                  | -       | -                                           |\n| -                 | `--version`, `-v`          | Show version                                                                                                        | -       | -                                           |\n\n## 🙋 FAQ\n\n### 🙈 How to exclude a directory?\n\nUse `ignore` with glob patterns. For example, to ignore all `admin` folders and one specific page:\n\n```typescript\n// svelte-sitemap.config.ts\nimport type { OptionsSvelteSitemap } from 'svelte-sitemap';\n\nconst config: OptionsSvelteSitemap = {\n  domain: 'https://www.example.com',\n  ignore: ['pages/my-secret-page', '**/admin/**']\n};\n```\n\n---\n\n### 📡 Ping Google Search Console\n\nEvery time you deploy a new version, you can inform Google that there's a new update.\nSee this [discussion](https://github.com/bartholomej/svelte-sitemap/issues/23) with very useful tips.\n\n---\n\n### ▲ Vercel adapter\n\nIf you're using `adapter-vercel`, the output directory is different from the default `build/`:\n\n```typescript\n// svelte-sitemap.config.ts\nimport type { OptionsSvelteSitemap } from 'svelte-sitemap';\n\nconst config: OptionsSvelteSitemap = {\n  domain: 'https://www.example.com',\n  outDir: '.vercel/output/static'\n};\n```\n\nOr check out [other solutions](https://github.com/bartholomej/svelte-sitemap/issues/16#issuecomment-961414454) and join the discussion.\n\n---\n\n### 🟠 Cloudflare adapter\n\nIf you're using `@sveltejs/adapter-cloudflare`, you need to exclude `sitemap.xml` from Cloudflare's routing in `svelte.config.js`:\n\n```diff\n-import adapter from '@sveltejs/adapter-auto';\n+import adapter from '@sveltejs/adapter-cloudflare';\n\n/** @type {import('@sveltejs/kit').Config} */\nconst config = {\n    kit: {\n-       adapter: adapter()\n+       adapter: adapter({ routes: { include: ['/*'], exclude: ['\u003call\u003e', '/sitemap.xml'] }})\n    }\n};\n\nexport default config;\n```\n\n---\n\n## 🐞 Common issues\n\n### ❌ Error: Missing folder\n\n```\n× Folder 'build/' doesn't exist. Make sure you are using this library as 'postbuild'\n  so 'build/' folder was successfully created before running this script.\n```\n\nMake sure the output folder exists. If your build outputs to a different folder than `build/`, use the `outDir` option in your config file.\n\n---\n\n### ❌ Error: Missing html files\n\n```\n× There is no static html file in your 'build/' folder.\n  Are you sure you are using Svelte adapter-static with prerender option?\n```\n\nThis library is intended for `adapter-static` with the `prerender` option (SSG). If there are no static HTML files in your build folder, this library won't work for you :'(\n\n---\n\n## ⭐️ Show your support\n\nGive a ⭐️ if this project helped you!\n\nOr if you are brave enough consider [making a donation](https://github.com/sponsors/bartholomej) for some 🍺 or 🍵 ;)\n\n## 🕵️ Privacy Policy\n\nI DO NOT STORE ANY DATA. PERIOD.\n\nI physically can't. I have nowhere to store it. I don't even have a server database to store it. So even if Justin Bieber asked nicely to see your data, I wouldn't have anything to show him.\n\nThat's why, with this library, what happens on your device stays on your device till disappear.\n\n## 🤝 Contributing\n\nI welcome you to customize this according to your needs ;)\n\nPull requests for any improvements would be great!\n\nFeel free to check [issues page](https://github.com/bartholomej/svelte-sitemap/issues).\n\n### 🛠️ Developing and debugging this library\n\n```bash\ngit clone git@github.com:bartholomej/svelte-sitemap.git\ncd svelte-sitemap\nyarn\nyarn start\n```\n\n#### Run demo locally\n\nYou can find and modify it in [`./demo.ts`](./demo.ts) file\n\n```bash\nyarn demo\n```\n\n## 🙏 Credits\n\n- svelte-sitemap is a workaround for [this official SvelteKit issue](https://github.com/sveltejs/kit/issues/1142)\n- Brand new version is inspired by [Richard's article](https://r-bt.com/learning/sveltekit-sitemap/)\n- Thanks to [@auderer](https://github.com/auderer) because [his issue](https://github.com/bartholomej/svelte-sitemap/issues/1) changed the direction of this library\n\n## 📝 License\n\nCopyright \u0026copy; 2026 [Lukas Bartak](http://bartweb.cz)\n\nProudly powered by nature 🗻, wind 💨, tea 🍵 and beer 🍺 ;)\n\nAll contents are licensed under the [MIT license].\n\n[mit license]: LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartholomej%2Fsvelte-sitemap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbartholomej%2Fsvelte-sitemap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbartholomej%2Fsvelte-sitemap/lists"}