{"id":32440525,"url":"https://github.com/marthijn/sidio.sitemap.core","last_synced_at":"2025-10-26T01:48:05.743Z","repository":{"id":221372786,"uuid":"754024592","full_name":"marthijn/Sidio.Sitemap.Core","owner":"marthijn","description":"Sidio.Sitemap.Core is a lightweight .NET library for generating sitemaps.","archived":false,"fork":false,"pushed_at":"2025-10-20T04:11:28.000Z","size":280,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-20T07:46:19.974Z","etag":null,"topics":["generating-sitemaps","sitemap","sitemap-files","sitemap-generator","sitemap-xml"],"latest_commit_sha":null,"homepage":"","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/marthijn.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":"SECURITY.md","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}},"created_at":"2024-02-07T08:53:10.000Z","updated_at":"2025-10-20T04:11:12.000Z","dependencies_parsed_at":"2024-03-22T16:29:30.736Z","dependency_job_id":"86096e56-bee4-4c56-a7b1-034321279897","html_url":"https://github.com/marthijn/Sidio.Sitemap.Core","commit_stats":null,"previous_names":["marthijn/sitemap.core","marthijn/sidio.sitemap.core"],"tags_count":28,"template":false,"template_full_name":null,"purl":"pkg:github/marthijn/Sidio.Sitemap.Core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marthijn%2FSidio.Sitemap.Core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marthijn%2FSidio.Sitemap.Core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marthijn%2FSidio.Sitemap.Core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marthijn%2FSidio.Sitemap.Core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/marthijn","download_url":"https://codeload.github.com/marthijn/Sidio.Sitemap.Core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/marthijn%2FSidio.Sitemap.Core/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281047795,"owners_count":26435124,"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","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["generating-sitemaps","sitemap","sitemap-files","sitemap-generator","sitemap-xml"],"created_at":"2025-10-26T01:48:04.975Z","updated_at":"2025-10-26T01:48:05.734Z","avatar_url":"https://github.com/marthijn.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"Sidio.Sitemap.Core\n=============\nSidio.Sitemap.Core is a lightweight .NET library for generating [sitemaps](https://www.sitemaps.org/). It supports sitemap index files and can be used in any .NET application. It is written in C# and is available via NuGet.\n\n[![NuGet Version](https://img.shields.io/nuget/v/Sidio.Sitemap.Core)](https://www.nuget.org/packages/Sidio.Sitemap.Core/)\n\n# Versions\n\n|            | [Sidio.Sitemap.Core](https://github.com/marthijn/Sidio.Sitemap.Core)| [Sidio.Sitemap.AspNetCore](https://github.com/marthijn/Sidio.Sitemap.AspNetCore)                                                                                                                                                               | [Sidio.Sitemap.Blazor](https://github.com/marthijn/Sidio.Sitemap.Blazor)                                                                                                                                                           |\n|------------|---------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| *NuGet*    | [![NuGet Version](https://img.shields.io/nuget/v/Sidio.Sitemap.Core)](https://www.nuget.org/packages/Sidio.Sitemap.Core/) | [![NuGet Version](https://img.shields.io/nuget/v/Sidio.Sitemap.AspNetCore)](https://www.nuget.org/packages/Sidio.Sitemap.AspNetCore/)                                                      | [![NuGet Version](https://img.shields.io/nuget/v/Sidio.Sitemap.Blazor)](https://www.nuget.org/packages/Sidio.Sitemap.Blazor/)                                                      |\n| *Build*    | [![build](https://github.com/marthijn/Sidio.Sitemap.Core/actions/workflows/build.yml/badge.svg)](https://github.com/marthijn/Sidio.Sitemap.Core/actions/workflows/build.yml)| [![build](https://github.com/marthijn/Sidio.Sitemap.AspNetCore/actions/workflows/build.yml/badge.svg)](https://github.com/marthijn/Sidio.Sitemap.AspNetCore/actions/workflows/build.yml)   | [![build](https://github.com/marthijn/Sidio.Sitemap.Blazor/actions/workflows/build.yml/badge.svg)](https://github.com/marthijn/Sidio.Sitemap.Blazor/actions/workflows/build.yml)   |\n| *Coverage* | [![Coverage Status](https://coveralls.io/repos/github/marthijn/Sidio.Sitemap.Core/badge.svg?branch=main)](https://coveralls.io/github/marthijn/Sidio.Sitemap.Core?branch=main)| [![Coverage Status](https://coveralls.io/repos/github/marthijn/Sidio.Sitemap.AspNetCore/badge.svg?branch=main)](https://coveralls.io/github/marthijn/Sidio.Sitemap.AspNetCore?branch=main) | [![Coverage Status](https://coveralls.io/repos/github/marthijn/Sidio.Sitemap.Blazor/badge.svg?branch=main)](https://coveralls.io/github/marthijn/Sidio.Sitemap.Blazor?branch=main) |\n| *Requirements*|.NET Standard, .NET 8+, | .NET 8+, AspNetCore|.NET 8+, AspNetCore, Blazor server|\n\n\n# Installation\nAdd [the package](https://www.nuget.org/packages/Sidio.Sitemap.Core/) to your project.\n\n# Usage\n_Looking for ASP.NET Core integration, see [Sidio.Sitemap.AspNetCore](https://github.com/marthijn/Sidio.Sitemap.AspNetCore). For Blazor integration, see [Sidio.Sitemap.Blazor](https://github.com/marthijn/Sidio.Sitemap.Blazor)._\n## Sitemap\n```csharp\nvar nodes = new List\u003cSitemapNode\u003e { new (\"https://example.com/page.html\") };\nvar sitemap = new Sitemap(nodes);\nvar service = new SitemapService(new XmlSerializer());\nvar xmlResult = service.Serialize();\n```\n\n## Sitemap index\n```csharp\nvar sitemapIndexNodes = new List\u003cSitemapIndexNode\u003e { new(\"https://example.com/sitemap-1.xml\") };\nvar sitemapIndex = new SitemapIndex(sitemapIndexNodes);\nvar service = new SitemapIndexService(new XmlSerializer());\nvar xmlResult = service.Serialize();\n```\n\n## Dependency injection\n```csharp\n// DI setup\nservices.AddDefaultSitemapServices();\n\n// implementation\npublic class MyClass()\n{\n    public MyClass(ISitemapService service)\n    {\n        var nodes = new List\u003cSitemapNode\u003e { new (\"https://example.com/page.html\") };\n        var sitemap = new Sitemap(nodes);\n        var xmlResult = service.Serialize();\n    }\n}    \n```\n\n## Working with relative URLs\n```csharp\npublic class MyBaseUrlProvider : IBaseUrlProvider\n{\n    public Uri BaseUrl =\u003e new (\"https://example.com\", UriKind.Absolute);\n}\n\n// DI setup\nservices.AddBaseUrlProvider\u003cMyBaseUrlProvider\u003e();\nservices.AddDefaultSitemapServices();\n// or in one function:\nservices.AddDefaultSitemapServices\u003cMyBaseUrlProvider\u003e();\n\n// regular setup\nvar serializer = new XmlSerializer(new MyBaseUrlProvider());\nvar service = new SitemapService(serializer);\n\n// nodes, relative urls\nvar nodes = new List\u003cSitemapNode\u003e { new (\"page.html\") };\n```\n\n## Extensions\n### Image sitemaps\n```csharp\nvar sitemap = new Sitemap();\nsitemap.Add(new SitemapImageNode(\"https://example.com/page.html\", new ImageLocation(\"https://example.com/image.png\")));\n```\n[Extension documentation on Google Search Central](https://developers.google.com/search/docs/crawling-indexing/sitemaps/image-sitemaps)\n\n### News sitemaps\n```csharp\nvar sitemap = new Sitemap();\nsitemap.Add(new SitemapNewsNode(\"https://example.com/page.html\", \"title\", \"name\", \"EN\", DateTimeOffset.UtcNow));\n```\n[Extension documentation on Google Search Central](https://developers.google.com/search/docs/crawling-indexing/sitemaps/news-sitemap)\n\n### Video sitemaps\n```csharp\nvar video = new VideoContent(\"https://example.com/thumbnail.png\", \"title\", \"description\", \"https://example.com/video.mp4\", null);\nvar sitemap = new Sitemap();\nsitemap.Add(new SitemapVideoNode(\"https://example.com/page.html\", video));\n```\n[Extension documentation on Google Search Central](https://developers.google.com/search/docs/crawling-indexing/sitemaps/video-sitemaps)\n\n## Stylesheets\nXSLT stylesheets for sitemaps and sitemap indexes are supported. The stylesheet can be added to the Sitemap or SitemapIndex object:\n```csharp\nvar sitemap = new Sitemap(nodes, \"my-stylesheet.xslt\");\n```\nFor more information, see [Sitemap Style](https://www.sitemap.style/).\n\n# Deserialization\nIt is possible to load existing XML and deserialize it into a sitemap object:\n```csharp\nvar xml = \"\u003c?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?\u003e\u003curlset\u003e ....\";\nvar serializer = services.GetRequiredService\u003cISitemapSerializer\u003e();\nvar sitemap = serializer.Deserialize(xml);\n```\n\n# Benchmarks XmlSerializer sync/async (Sitemap)\n```\n\nBenchmarkDotNet v0.14.0, Windows 11 (10.0.22631.4460/23H2/2023Update/SunValley3)\nAMD Ryzen 7 5800H with Radeon Graphics, 1 CPU, 16 logical and 8 physical cores\n.NET SDK 9.0.100\n  [Host]   : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2\n  .NET 8.0 : .NET 8.0.11 (8.0.1124.51707), X64 RyuJIT AVX2\n  .NET 9.0 : .NET 9.0.0 (9.0.24.52809), X64 RyuJIT AVX2\n\n```\n| Method         | Job      | Runtime  | NumberOfNodes | Mean          | Error       | StdDev      | Ratio | RatioSD |\n|--------------- |--------- |--------- |-------------- |--------------:|------------:|------------:|------:|--------:|\n| Serialize      | .NET 8.0 | .NET 8.0 | 10            |      5.153 us |   0.0971 us |   0.0758 us |  1.00 |    0.02 |\n| Serialize      | .NET 9.0 | .NET 9.0 | 10            |      4.585 us |   0.0894 us |   0.0792 us |  0.89 |    0.02 |\n|                |          |          |               |               |             |             |       |         |\n| SerializeAsync | .NET 8.0 | .NET 8.0 | 10            |      6.312 us |   0.0733 us |   0.0650 us |  1.00 |    0.01 |\n| SerializeAsync | .NET 9.0 | .NET 9.0 | 10            |      5.482 us |   0.0189 us |   0.0167 us |  0.87 |    0.01 |\n|                |          |          |               |               |             |             |       |         |\n| Serialize      | .NET 8.0 | .NET 8.0 | 100           |     41.446 us |   0.4271 us |   0.3995 us |  1.00 |    0.01 |\n| Serialize      | .NET 9.0 | .NET 9.0 | 100           |     38.711 us |   0.3524 us |   0.3124 us |  0.93 |    0.01 |\n|                |          |          |               |               |             |             |       |         |\n| SerializeAsync | .NET 8.0 | .NET 8.0 | 100           |     51.229 us |   0.4338 us |   0.4057 us |  1.00 |    0.01 |\n| SerializeAsync | .NET 9.0 | .NET 9.0 | 100           |     46.347 us |   0.7401 us |   0.6923 us |  0.90 |    0.01 |\n|                |          |          |               |               |             |             |       |         |\n| Serialize      | .NET 8.0 | .NET 8.0 | 40000         | 23,239.956 us | 428.2431 us | 400.5788 us |  1.00 |    0.02 |\n| Serialize      | .NET 9.0 | .NET 9.0 | 40000         | 23,396.317 us | 334.0125 us | 312.4355 us |  1.01 |    0.02 |\n|                |          |          |               |               |             |             |       |         |\n| SerializeAsync | .NET 8.0 | .NET 8.0 | 40000         | 23,490.278 us | 251.5840 us | 223.0227 us |  1.00 |    0.01 |\n| SerializeAsync | .NET 9.0 | .NET 9.0 | 40000         | 23,334.005 us | 253.3734 us | 237.0057 us |  0.99 |    0.01 |\n\n\n# References\n- [Sitemap protocol](https://www.sitemaps.org/protocol.html)\n- [Sitemaps on Google Search Central](https://developers.google.com/search/docs/crawling-indexing/sitemaps/overview)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarthijn%2Fsidio.sitemap.core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarthijn%2Fsidio.sitemap.core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarthijn%2Fsidio.sitemap.core/lists"}