{"id":33931033,"url":"https://github.com/goddtriffin/sitemap-rs","last_synced_at":"2026-04-08T13:31:15.989Z","repository":{"id":58483077,"uuid":"532052372","full_name":"goddtriffin/sitemap-rs","owner":"goddtriffin","description":"A Rust library to generate URL, Index, Image, Video, and News sitemaps.","archived":false,"fork":false,"pushed_at":"2025-08-30T19:24:59.000Z","size":113,"stargazers_count":29,"open_issues_count":4,"forks_count":6,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-13T22:35:20.578Z","etag":null,"topics":["bing-webmaster","google-search-console","rust","seo","seo-optimization","seo-tools","sitemap","sitemap-generator","xml"],"latest_commit_sha":null,"homepage":"https://docs.rs/sitemap-rs","language":"Rust","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/goddtriffin.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-09-02T19:20:59.000Z","updated_at":"2025-10-11T19:03:43.000Z","dependencies_parsed_at":"2025-02-22T23:24:25.605Z","dependency_job_id":"7caa2a83-0eac-4cc3-987f-65260ab65675","html_url":"https://github.com/goddtriffin/sitemap-rs","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/goddtriffin/sitemap-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goddtriffin%2Fsitemap-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goddtriffin%2Fsitemap-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goddtriffin%2Fsitemap-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goddtriffin%2Fsitemap-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/goddtriffin","download_url":"https://codeload.github.com/goddtriffin/sitemap-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/goddtriffin%2Fsitemap-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31558380,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T10:21:54.569Z","status":"ssl_error","status_checked_at":"2026-04-08T10:21:38.171Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: 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":["bing-webmaster","google-search-console","rust","seo","seo-optimization","seo-tools","sitemap","sitemap-generator","xml"],"created_at":"2025-12-12T12:25:38.607Z","updated_at":"2026-04-08T13:31:15.979Z","avatar_url":"https://github.com/goddtriffin.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sitemap-rs\r\n\r\n[![Version](https://img.shields.io/crates/v/sitemap-rs)](https://crates.io/crates/sitemap-rs)\r\n[![Docs](https://docs.rs/sitemap-rs/badge.svg)](https://docs.rs/sitemap-rs)\r\n\r\nA Rust library to generate URL, Index, Image, Video, and News sitemaps.\r\n\r\n## Features\r\n\r\n### Generates sitemaps\r\n\r\n- [URL sitemaps](https://www.sitemaps.org/protocol.html)\r\n- [Index sitemaps](https://www.sitemaps.org/protocol.html)\r\n- [Image sitemaps](https://developers.google.com/search/docs/advanced/sitemaps/image-sitemaps)\r\n- [Video sitemaps](https://developers.google.com/search/docs/advanced/sitemaps/video-sitemaps)\r\n- [News sitemaps](https://developers.google.com/search/docs/advanced/sitemaps/news-sitemap)\r\n\r\n### Validates sitemap data\r\n\r\nThere are a bunch of restrictions as to what data your sitemaps can hold. This\r\nlibrary surfaces these validation issues at struct instantiation time. Now you\r\ndon't have to wait for\r\n[Google Search Console](https://search.google.com/search-console/about) or\r\n[Bing Webmaster Tools](https://www.bing.com/webmasters/tools) to alert you of\r\nsitemap issues before you can fix data problems.\r\n\r\n#### Validations\r\n\r\n- URL Sitemap\r\n  - `LocationTooLong`\r\n    - A `\u003cloc\u003e` must be less than `2,048` characters.\r\n  - `TooManyUrls`\r\n    - Can only contain as many as `50,000` `\u003curl\u003e`.\r\n  - `TooMuchNews`\r\n    - Can only contain as many as `1,000` `\u003cnews: news\u003e`.\r\n  - `PriorityTooLow` and `PriorityTooHigh`\r\n    - A `\u003cpriority\u003e` must be between `0.0` and `1.0` (inclusive).\r\n  - `TooManyImages`\r\n    - Can only contain as many as `1,000` `\u003cimage: image\u003e`.\r\n- Index Sitemap\r\n  - `TooManySitemaps`\r\n    - Can only contain as many as `50,000` `\u003csitemap\u003e`.\r\n- Video Sitemap\r\n  - `DescriptionTooLong`\r\n    - A `\u003cdescription\u003e` must be no longer than `2048` characters.\r\n  - `DurationTooShort` and `DurationTooLong`\r\n    - A `\u003cduration\u003e` must be between `1` and `28,800` seconds (inclusive).\r\n  - `RatingTooLow` and `RatingTooHigh`\r\n    - A `\u003crating\u003e` must be between `0.0` and `5.0` (inclusive).\r\n  - `UploaderNameTooLong`\r\n    - An `\u003cuploader\u003e`'s `\u003cname\u003e` must be no longer than `255` characters.\r\n  - `TooManyTags`\r\n    - Must contain no more than `32` `\u003ctag\u003e`.\r\n\r\n## Restrictions\r\n\r\nThis library **cannot** parse sitemaps of any kind (yet! - pull requests\r\nwelcome! See Feature Requests section below).\r\n\r\n## Examples\r\n\r\n### URL Sitemap\r\n\r\n`cargo run --example generate_url_sitemap`\r\n\r\n```xml\r\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\r\n\u003curlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:xhtml=\"http://www.w3.org/1999/xhtml\"\u003e\r\n\t\u003curl\u003e\r\n\t\t\u003cloc\u003ehttps://www.toddgriffin.me/\u003c/loc\u003e\r\n\t\t\u003cxhtml:link rel=\"alternate\" hreflang=\"de\" href=\"https://www.toddgriffin.me/de\" /\u003e\r\n\t\t\u003clastmod\u003e1998-01-15T04:20:00+00:00\u003c/lastmod\u003e\r\n\t\t\u003cchangefreq\u003emonthly\u003c/changefreq\u003e\r\n\t\t\u003cpriority\u003e0.69\u003c/priority\u003e\r\n\t\u003c/url\u003e\r\n\u003c/urlset\u003e\r\n```\r\n\r\n### Index Sitemap\r\n\r\n`cargo run --example generate_index_sitemap`\r\n\r\n```xml\r\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\r\n\u003csitemapindex xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\"\u003e\r\n\t\u003csitemap\u003e\r\n\t\t\u003cloc\u003ehttps://www.toddgriffin.me/sitemap1.xml.gz\u003c/loc\u003e\r\n\t\t\u003clastmod\u003e1998-01-15T04:20:00+00:00\u003c/lastmod\u003e\r\n\t\u003c/sitemap\u003e\r\n\t\u003csitemap\u003e\r\n\t\t\u003cloc\u003ehttps://www.toddgriffin.me/sitemap2.xml.gz\u003c/loc\u003e\r\n\t\t\u003clastmod\u003e2000-01-31T04:20:00+00:00\u003c/lastmod\u003e\r\n\t\u003c/sitemap\u003e\r\n\u003c/sitemapindex\u003e\r\n```\r\n\r\n### Image Sitemap\r\n\r\n`cargo run --example generate_image_sitemap`\r\n\r\n```xml\r\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\r\n\u003curlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:image=\"http://www.google.com/schemas/sitemap-image/1.1\"\u003e\r\n\t\u003curl\u003e\r\n\t\t\u003cloc\u003ehttps://www.toddgriffin.me/sample1.html\u003c/loc\u003e\r\n\t\t\u003cimage:image\u003e\r\n\t\t\t\u003cimage:loc\u003ehttps://www.toddgriffin.me/image.jpg\u003c/image:loc\u003e\r\n\t\t\u003c/image:image\u003e\r\n\t\t\u003cimage:image\u003e\r\n\t\t\t\u003cimage:loc\u003ehttps://www.toddgriffin.me/photo.jpg\u003c/image:loc\u003e\r\n\t\t\u003c/image:image\u003e\r\n\t\u003c/url\u003e\r\n\t\u003curl\u003e\r\n\t\t\u003cloc\u003ehttps://www.toddgriffin.me/sample2.html\u003c/loc\u003e\r\n\t\t\u003cimage:image\u003e\r\n\t\t\t\u003cimage:loc\u003ehttps://www.toddgriffin.me/picture.jpg\u003c/image:loc\u003e\r\n\t\t\u003c/image:image\u003e\r\n\t\u003c/url\u003e\r\n\u003c/urlset\u003e\r\n```\r\n\r\n### Video Sitemap\r\n\r\n`cargo run --example generate_video_sitemap`\r\n\r\n```xml\r\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\r\n\u003curlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:video=\"http://www.google.com/schemas/sitemap-video/1.1\"\u003e\r\n\t\u003curl\u003e\r\n\t\t\u003cloc\u003ehttps://www.toddgriffin.me/videos/some_video_landing_page.html\u003c/loc\u003e\r\n\t\t\u003cvideo:video\u003e\r\n\t\t\t\u003cvideo:thumbnail_loc\u003ehttps://www.toddgriffin.me/thumbs/123.jpg\u003c/video:thumbnail_loc\u003e\r\n\t\t\t\u003cvideo:title\u003eGrilling steaks for summer\u003c/video:title\u003e\r\n\t\t\t\u003cvideo:description\u003eAlkis shows you how to get perfectly done steaks every time\u003c/video:description\u003e\r\n\t\t\t\u003cvideo:content_loc\u003ehttps://www.toddgriffin.me/video123.mp4\u003c/video:content_loc\u003e\r\n\t\t\t\u003cvideo:player_loc\u003ehttps://www.toddgriffin.me/videoplayer.php?video=123\u003c/video:player_loc\u003e\r\n\t\t\t\u003cvideo:duration\u003e600\u003c/video:duration\u003e\r\n\t\t\t\u003cvideo:expiration_date\u003e2021-11-05T19:20:30+08:00\u003c/video:expiration_date\u003e\r\n\t\t\t\u003cvideo:rating\u003e4.2\u003c/video:rating\u003e\r\n\t\t\t\u003cvideo:view_count\u003e8633\u003c/video:view_count\u003e\r\n\t\t\t\u003cvideo:publication_date\u003e1998-01-15T12:20:00+08:00\u003c/video:publication_date\u003e\r\n\t\t\t\u003cvideo:family_friendly\u003eyes\u003c/video:family_friendly\u003e\r\n\t\t\t\u003cvideo:restriction relationship=\"allow\"\u003eCA GB IE US\u003c/video:restriction\u003e\r\n\t\t\t\u003cvideo:platform relationship=\"allow\"\u003etv web\u003c/video:platform\u003e\r\n\t\t\t\u003cvideo:requires_subscription\u003eyes\u003c/video:requires_subscription\u003e\r\n\t\t\t\u003cvideo:uploader info=\"https://www.toddgriffin.me/users/grillymcgrillerson\"\u003eGrillyMcGrillserson\u003c/video:uploader\u003e\r\n\t\t\t\u003cvideo:live\u003eno\u003c/video:live\u003e\r\n\t\t\t\u003cvideo:tag\u003esteak\u003c/video:tag\u003e\r\n\t\t\t\u003cvideo:tag\u003emeat\u003c/video:tag\u003e\r\n\t\t\t\u003cvideo:tag\u003esummer\u003c/video:tag\u003e\r\n\t\t\t\u003cvideo:tag\u003eoutdoor\u003c/video:tag\u003e\r\n\t\t\u003c/video:video\u003e\r\n\t\u003c/url\u003e\r\n\u003c/urlset\u003e\r\n```\r\n\r\n### News Sitemap\r\n\r\n`cargo run --example generate_news_sitemap`\r\n\r\n```xml\r\n\u003c?xml version=\"1.0\" encoding=\"UTF-8\"?\u003e\r\n\u003curlset xmlns=\"http://www.sitemaps.org/schemas/sitemap/0.9\" xmlns:news=\"http://www.google.com/schemas/sitemap-news/0.9\"\u003e\r\n\t\u003curl\u003e\r\n\t\t\u003cloc\u003ehttps://www.toddgriffin.me/business/article55.html\u003c/loc\u003e\r\n\t\t\u003cnews:news\u003e\r\n\t\t\t\u003cnews:publication\u003e\r\n\t\t\t\t\u003cnews:name\u003eThe Example Times\u003c/news:name\u003e\r\n\t\t\t\t\u003cnews:language\u003een\u003c/news:language\u003e\r\n\t\t\t\u003c/news:publication\u003e\r\n\t\t\t\u003cnews:publication_date\u003e1998-01-15T04:20:00+00:00\u003c/news:publication_date\u003e\r\n\t\t\t\u003cnews:title\u003eCompanies A, B in Merger Talks\u003c/news:title\u003e\r\n\t\t\u003c/news:news\u003e\r\n\t\u003c/url\u003e\r\n\u003c/urlset\u003e\r\n```\r\n\r\n## Alternative libraries\r\n\r\n_The `rust-sitemap` and `sitewriter` libraries are by far the best\r\nalternatives._\r\n\r\n_This pro/con list is accurate as of the most recent update to this document._\r\n\r\n### [rust-sitemap](https://github.com/svmk/rust-sitemap)\r\n\r\n#### Pros:\r\n\r\n- Supports URL, Index sitemaps\r\n- Supports reading files\r\n- Supports writing files\r\n\r\n#### Cons:\r\n\r\n- Doesn't support Image, Video, News sitemaps\r\n- Only supports some validations\r\n- Low struct/method documentation\r\n\r\n### [sitewriter](https://github.com/edg-l/sitewriter)\r\n\r\n#### Pros:\r\n\r\n- Supports URL sitemaps\r\n- Supports writing files\r\n- Support builder pattern\r\n- uses [quick-xml](https://github.com/tafia/quick-xml), so it should be quite\r\n  fast\r\n- Some struct/method documentation\r\n\r\n#### Cons:\r\n\r\n- Doesn't support Index, Image, Video, News sitemaps\r\n- Doesn't support reading files\r\n- Zero data validations\r\n\r\n### [sitemap-iter](https://github.com/Icelk/sitemap-iter/)\r\n\r\n#### Pros:\r\n\r\n- Supports URL sitemaps\r\n- Supports reading files\r\n\r\n#### Cons:\r\n\r\n- Doesn't support Index, Image, Video, News sitemaps\r\n- Doesn't support writing files\r\n- Zero data validations\r\n- Low struct/method documentation\r\n\r\n### [rust-sitemap-writer](https://github.com/uiuifree/rust-sitemap-writer)\r\n\r\n#### Pros:\r\n\r\n- Supports URL sitemaps\r\n- Supports writing files\r\n\r\n#### Cons:\r\n\r\n- Doesn't support Index, Image, Video, News sitemaps\r\n- Doesn't support reading files\r\n- Zero data validations\r\n- Zero struct/method documentation\r\n\r\n### [mdbook-sitemap-generator](https://github.com/rxdn/mdbook-sitemap-generator)\r\n\r\n#### Pros:\r\n\r\n- Semi-supports URL sitemaps\r\n- Supports writing files\r\n\r\n#### Cons:\r\n\r\n- Not a general use sitemap library\r\n- Doesn't support every possible tag of URL sitemaps\r\n- Doesn't support Index, Image, Video, News sitemaps\r\n- Doesn't support reading files\r\n- Zero data validations\r\n- Zero struct/method documentation\r\n\r\n## Developers\r\n\r\n**Project is under active maintenance - even if there are no recent commits!\r\nPlease submit an issue / bug request if the library needs updating for any\r\nreason!**\r\n\r\n### Philosophy\r\n\r\nThis library should be fast, efficient, strictly adhere to the Sitemap\r\nspecification, and strictly adhere to Google Search Console's best practices.\r\n\r\nA feature request will be accepted if it exists in the specification and if it\r\nis a best practice to use it.\r\n\r\nFor example, here are some deprecated Image Sitemap fields: `\u003cimage:caption\u003e`,\r\n`\u003cimage:geo_location\u003e`, `\u003cimage:title\u003e`, `\u003cimage:license\u003e`. While the\r\nspecification technically describes these fields, Google Search Console's best\r\npractices is to omit them.\r\n\r\n\u003e Over the years, we introduced a number of tags and tag attributes for Google\r\n\u003e sitemap extensions, specifically the Image and Video extensions.\r\n\u003e\r\n\u003e Most of these tags were added to allow site owners to deliver data more easily\r\n\u003e to Search. Upon evaluating the value of the Google sitemap extension tags, we\r\n\u003e decided to officially deprecate some tags and attributes, and remove them from\r\n\u003e our documentation. The deprecated tags will have no effect on indexing and\r\n\u003e search features after August 6, 2022.\r\n\u003e\r\n\u003e If you are a sitemap plugin developer or manage your own sitemaps, there's no\r\n\u003e immediate action required; you can leave these tags and attributes in place\r\n\u003e without drawbacks. In the future, Search Console may show warnings once these\r\n\u003e updates are included in the next schema versions of the Image and Video\r\n\u003e extensions.\r\n\r\nSource:\r\nhttps://developers.google.com/search/docs/crawling-indexing/sitemaps/image-sitemaps\r\n\r\nAny contribution which doesn't follow this philosophy will unfortunately be\r\nclosed.\r\n\r\nOn the flip side, if this library has not implemented any feature of the Sitemap\r\nspec - it must be implemented!\r\n\r\n### Specification\r\n\r\n- https://www.sitemaps.org/protocol.html\r\n- https://developers.google.com/search/docs/crawling-indexing/sitemaps/build-sitemap#xml\r\n- https://developers.google.com/search/docs/specialty/international/localized-versions#sitemap\r\n  - https://developers.google.com/search/docs/specialty/international/localized-versions#all-method-guidelines\r\n  - https://developers.google.com/search/docs/specialty/international/localized-versions#xdefault\r\n\r\n### Feature Requests\r\n\r\nThese are extremely high priority! Very open to contributions!\r\n\r\n- `Replace xml-builder dependency with quick-xml (faster + enable reading sitemaps)`: https://github.com/goddtriffin/sitemap-rs/issues/14\r\n- `Add strict validations: ISO 3166 Country Code, ISO 639 Part 1 Language Code, ISO 15924 Language Script Variations`: https://github.com/goddtriffin/sitemap-rs/issues/15\r\n\r\n### Commands\r\n\r\n- `make lint`\r\n- `make test`\r\n- `make fix`\r\n\r\n## Credits\r\n\r\nMade by [Todd Everett Griffin](https://www.toddgriffin.me/).\r\n\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoddtriffin%2Fsitemap-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoddtriffin%2Fsitemap-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoddtriffin%2Fsitemap-rs/lists"}