{"id":48211895,"url":"https://github.com/hallojoe/xml-sitemaps","last_synced_at":"2026-04-04T18:49:03.939Z","repository":{"id":254696161,"uuid":"845696053","full_name":"hallojoe/xml-sitemaps","owner":"hallojoe","description":"A package for creating XML sitemaps in AspNetCore applications.","archived":false,"fork":false,"pushed_at":"2024-09-22T10:28:08.000Z","size":852,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-22T16:24:56.412Z","etag":null,"topics":["sitemap","xml"],"latest_commit_sha":null,"homepage":"https://github.com/hallojoe/xml-sitemaps","language":"C#","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/hallojoe.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":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-21T18:44:13.000Z","updated_at":"2024-09-22T10:20:40.000Z","dependencies_parsed_at":"2024-08-29T23:07:28.124Z","dependency_job_id":null,"html_url":"https://github.com/hallojoe/xml-sitemaps","commit_stats":null,"previous_names":["hallojoe/xml-sitemaps"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/hallojoe/xml-sitemaps","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hallojoe%2Fxml-sitemaps","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hallojoe%2Fxml-sitemaps/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hallojoe%2Fxml-sitemaps/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hallojoe%2Fxml-sitemaps/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hallojoe","download_url":"https://codeload.github.com/hallojoe/xml-sitemaps/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hallojoe%2Fxml-sitemaps/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31409470,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"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":["sitemap","xml"],"created_at":"2026-04-04T18:49:03.844Z","updated_at":"2026-04-04T18:49:03.915Z","avatar_url":"https://github.com/hallojoe.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"﻿# XML Sitemaps\n\nZero config XML sitemaps. A thing for creating XML sitemaps in AspNetCore applications. \n\n## Get started\n\nFollow these instructions to get started.\n\n### Install\n\n`dotnet add package Casko.AspNetCore.XmlSiteMaps --version 1.0.0`\n\n### Configure\n\nIn `Startup.cs` or `Program.cs`, add XML sitemaps on `IServiceCollection`:\n\n```\nservices.AddXmlSiteMaps();\n```\n\nIn `Startup.cs` or `Program.cs`,  use XML sitemaps on `IApplicationBuilder`:\n\n```\napp.UseXmlSiteMaps(addRewrites: true); // true is default\n```\n\nIf ordering creates problems for rewrites then set `useRewrites: false` and then call where it fit in:\n\n```\napp.UseXmlSiteMapsRewrites();\n```\n\nAfter configuring XmlSiteMaps, then implementations of `IXmlSiteMap\u003cXmlSiteMapIndex\u003e`, `IXmlSiteMap\u003cXmlSiteMap\u003e`, `IXmlSiteMapCollection\u003cXmlSiteMap\u003e` and `IXmlSiteMapCollection\u003cXmlSiteMapIndex\u003e` will be picked up on application startup and endpoints and rewrites will be setup. \n\nXML sitemaps will be served from `api/xml-sitemaps/...` and URL rewrites will be created and point `FileName` to it's corresponding endpoint.\n\n### Implement\n\nExample code for creating different XML sitemap things.\n\n#### Create a single XML sitemap:\n\nSimplest for of XML sitemap.\n\n```\npublic class XmlSiteMapService : IXmlSiteMap\u003cXmlSiteMap\u003e\n{\n    public string FileName =\u003e \"sitemap.xml\";\n\n    public XmlSiteMap GetXmlSiteMap()\n    {\n        var xmlSiteMap = new XmlSiteMap();\n        \n        xmlSiteMap.Urls.Add(new XmlSiteMapUrl()\n        {\n            Location = \"https://...\",\n            LastModified = DateTime.UtcNow,\n            ChangeFrequency = ChangeFrequency.Daily,\n            Priority = .5\n        });\n\n        ...\n\n        return xmlSiteMap;\n    }\n}\n```\n\n#### Create a XML sitemap index:\n\nWhen multiple XML sitemaps exist you will need at least one XML sitemap index.\n\n```\npublic class XmlSiteMapIndexService : IXmlSiteMap\u003cXmlSiteMapIndex\u003e\n{\n    public string FileName =\u003e \"sitemap.xml\";\n\n    public XmlSiteMapIndex GetXmlSiteMap()\n    {\n        var xmlSiteMapIndex = new XmlSiteMapIndex();\n        \n        xmlSiteMap.Locations.Add(new XmlSiteMapIndexLocation()\n        {\n            Location = \"https://...\",\n        });\n\n        ...\n\n        return xmlSiteMapIndex;\n    }\n}\n```\n\n#### Create XML sitemap collection:\n\nCreate many XML sitemaps with a single implementation.\n\n```\npublic class XmlSiteMapCollectionService() : IXmlSiteMapCollection\u003cXmlSiteMap\u003e\n{\n    public IDictionary\u003cstring, string\u003e Routes =\u003e new Dictionary\u003cstring, string\u003e()\n    {\n        { \"en\", \"sitemap-collection-default.xml\" },\n        { \"da\", \"sitemap-collection-da.xml\" },\n        { \"es\", \"sitemap-collection-es.xml\" },\n    };\n\n    public XmlSiteMap GetXmlSiteMap(string key)\n    {\n        var xmlSiteMap = new XmlSiteMap();\n\n        ...Create things using \"key\"\n        \n        xmlSiteMap.Urls.Add(new XmlSiteMapUrl()\n        {\n            Location = $\"https://...{key}\",\n            LastModified = DateTime.UtcNow,\n            ChangeFrequency = ChangeFrequency.Daily,\n            Priority = .5\n        });\n        \n        return xmlSiteMap;\n    }\n}\n\n```\n\n\n## Changelog\n\n### 2.0.0\n\n- Add HttpContext to signature of `ISiteMap.GetXmlSiteMap` \n- Pass HttpContext when building endpoints\n\n### 1.0.1\n\n- Remove required operator from Rel property of XHtmlLink\n\n### 1.0.0\n\n - Initialize project\n\n\n\n\n## TODO\n\n - Offer automatic XML sitemap index creation when creating `IXmlSitemapCollection\u003cXmlSiteMap\u003e`\n - Make XHtmlLink not required","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhallojoe%2Fxml-sitemaps","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhallojoe%2Fxml-sitemaps","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhallojoe%2Fxml-sitemaps/lists"}