{"id":13825638,"url":"https://github.com/netlify-labs/netlify-plugin-sitemap","last_synced_at":"2025-07-08T22:31:48.219Z","repository":{"id":38370431,"uuid":"225967158","full_name":"netlify-labs/netlify-plugin-sitemap","owner":"netlify-labs","description":"Automatically Generate sitemaps on build","archived":false,"fork":false,"pushed_at":"2023-07-09T14:47:07.000Z","size":1175,"stargazers_count":144,"open_issues_count":31,"forks_count":22,"subscribers_count":5,"default_branch":"main","last_synced_at":"2024-11-06T15:53:14.556Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/netlify-labs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2019-12-04T22:16:48.000Z","updated_at":"2024-09-18T18:48:50.000Z","dependencies_parsed_at":"2024-01-18T04:02:52.292Z","dependency_job_id":"6d75193d-c36f-4aab-a162-6a3c02733e33","html_url":"https://github.com/netlify-labs/netlify-plugin-sitemap","commit_stats":{"total_commits":74,"total_committers":12,"mean_commits":6.166666666666667,"dds":0.6756756756756757,"last_synced_commit":"8f71ba17615b81253dac76e1d5e0b9d67601b791"},"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netlify-labs%2Fnetlify-plugin-sitemap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netlify-labs%2Fnetlify-plugin-sitemap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netlify-labs%2Fnetlify-plugin-sitemap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/netlify-labs%2Fnetlify-plugin-sitemap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/netlify-labs","download_url":"https://codeload.github.com/netlify-labs/netlify-plugin-sitemap/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225470631,"owners_count":17479366,"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":[],"created_at":"2024-08-04T09:01:24.610Z","updated_at":"2024-11-20T04:30:40.503Z","avatar_url":"https://github.com/netlify-labs.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# Netlify sitemap plugin\n\nAutomatically generate a sitemap for your site after it finishes building in Netlify.\n\n## Installation\n\nYou can install this plugin in the Netlify UI from this [direct in-app installation link](https://app.netlify.com/plugins/@netlify/plugin-sitemap/install) or from the [Plugins directory](https://app.netlify.com/plugins).\n\nTo use file-based installation, add the following lines to your `netlify.toml` file:\n\n```toml\n[[plugins]]\npackage = \"@netlify/plugin-sitemap\"\n```\n\nNote: The `[[plugins]]` line is required for each plugin, even if you have other plugins in your `netlify.toml` file already.\n\nTo complete file-based installation, from your project's base directory, use npm, yarn, or any other Node.js package manager to add this plugin to devDependencies in `package.json`.\n\n```\nnpm install -D @netlify/plugin-sitemap\n```\n\n## Configuration\n\nBy default, the plugin generates a sitemap based on the `publish` directory configured in your site build settings or `netlify.toml`.\nTo change the default behavior use the `buildDir` configuration.\n\n```toml\n[[plugins]]\npackage = \"@netlify/plugin-sitemap\"\n\n  [plugins.inputs]\n  buildDir = \"public\"\n```\n\n### Writing to a subfolder path\n\nIf your site is meant to be served from a subfolder, you can also apply the `filePath` parameter in order to place the `sitemap.xml` in a particular location _within_ in the `buildDir`. NOTE: this parameter must contain the full file name including \"sitemap.xml\".\n\n```toml\n[[plugins]]\npackage = \"@netlify/plugin-sitemap\"\n\n  [plugins.inputs]\n  buildDir = \"public\"\n  filePath = \"some/subfolder/sitemap.xml\"\n```\n\n### Excluding files from sitemap\n\n```toml\n[[plugins]]\npackage = \"@netlify/plugin-sitemap\"\n\n  [plugins.inputs]\n  buildDir = \"public\"\n  exclude = [\n    # By file Path\n    './build-dir/path-to/file.html',\n    # By Glob pattern\n    '**/**/child-one.html'\n  ]\n```\n\n### Pretty URLs\n\nPretty urls a.k.a. `site.com/index.html` being turned into  `site.com/` is on by default.\n\nTo disable this feature set the `prettyURLs` option to `false`\n\n```toml\n[[plugins]]\npackage = \"@netlify/plugin-sitemap\"\n\n  [plugins.inputs]\n  buildDir = \"public\"\n  # disable pretty URLS and keep `index.html` \u0026 trailing `.html` file references in paths\n  prettyURLs = false\n```\n\nWhen using pretty URLs, missing trailing slashes can be appended by setting the `trailingSlash` option to `true`. This renders `site.com/page-one.html` as `site.com/page-one/`.\n\n```toml\n[[plugins]]\npackage = \"@netlify/plugin-sitemap\"\n\n  [plugins.inputs]\n  buildDir = \"public\"\n  prettyURLs = true\n  # Append missing trailing slash to pretty URL\n  trailingSlash = true\n```\n\n### Set the default values for \"changefreq\" and \"priority\"\n\n```toml\n[[plugins]]\npackage = \"@netlify/plugin-sitemap\"\n\n  [plugins.inputs]\n  changeFreq = \"daily\"\n  priority = 0.5\n```\n### Set base URL from environment variable rather than plugin input\n\nYou can include an environment variable (`NETLIFY_PLUGIN_SITEMAP_BASEURL`) in your Netlify site to set the base URL that will be used by the plugin. This option is useful if the `baseUrl` plugin input can't be used.\nExample use case: different Netlify sites built from the same repository and don't/can't have custom domains.\n\nPriority of base URL assignment:\nplugin input `baseUrl` -\u003e env `NETLIFY_PLUGIN_SITEMAP_BASEURL` -\u003e Netlify site default URL\n\n```toml\n[[plugins]]\npackage = \"@netlify/plugin-sitemap\"\n\n  [plugins.inputs]\n  baseUrl = \"http://example.com\"\n```\n\n\u003e  NOTE: Although the above is called base URL this actually ends up being the hostname in the sitemap and as such trying to use a URL like `http://example.com/en/` will results in `http://example.com/`\n\n### Add a prefix to the URL\n\nYou can include an environment variable (NETLIFY_PLUGIN_SITEMAP_URL_PREFIX) in your Netlify site to set the URL prefix that will be used by the plugin. This option is useful if the urlPrefix plugin input can't be used. Example use case: different Netlify sites built from the same repository and don't/can't have custom domains.\n\nPriority of base URL assignment: plugin input urlPrefix -\u003e env NETLIFY_PLUGIN_SITEMAP_URL_PREFIX\n\n```toml\n[[plugins]]\npackage = \"@netlify/plugin-sitemap\"\n\n  [plugins.inputs]\n  urlPrefix = \"/en/\"\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetlify-labs%2Fnetlify-plugin-sitemap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnetlify-labs%2Fnetlify-plugin-sitemap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnetlify-labs%2Fnetlify-plugin-sitemap/lists"}