{"id":23944803,"url":"https://github.com/pscourtney/blazorserverdynamicsitemap","last_synced_at":"2026-02-13T09:02:41.747Z","repository":{"id":176996356,"uuid":"599211796","full_name":"PSCourtney/BlazorServerDynamicSitemap","owner":"PSCourtney","description":"A dynamic sitemap xml generator for blazor server","archived":false,"fork":false,"pushed_at":"2024-10-12T08:45:30.000Z","size":493,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-22T14:29:14.552Z","etag":null,"topics":["blazor","blazorserver","sitemap"],"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/PSCourtney.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,"zenodo":null}},"created_at":"2023-02-08T17:23:36.000Z","updated_at":"2024-10-14T11:13:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"f73809c7-ea43-4e19-8c41-121c443394fb","html_url":"https://github.com/PSCourtney/BlazorServerDynamicSitemap","commit_stats":null,"previous_names":["pscourtney/blazorserverdynamicsitemap"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSCourtney%2FBlazorServerDynamicSitemap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSCourtney%2FBlazorServerDynamicSitemap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSCourtney%2FBlazorServerDynamicSitemap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSCourtney%2FBlazorServerDynamicSitemap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PSCourtney","download_url":"https://codeload.github.com/PSCourtney/BlazorServerDynamicSitemap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PSCourtney%2FBlazorServerDynamicSitemap/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":258000686,"owners_count":22634576,"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":["blazor","blazorserver","sitemap"],"created_at":"2025-01-06T07:14:40.006Z","updated_at":"2026-02-13T09:02:36.703Z","avatar_url":"https://github.com/PSCourtney.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dynamic Sitemap for Blazor Server\nA dynamic sitemap xml generator for Blazor Server.  \n\n![](https://i.imgur.com/yLXVXc0.jpeg)\n\n\n## Usage\nMake sitemap.xml a navigible endpoint in `Program.cs`\n```cs\napp.UseEndpoints(endpoints =\u003e\n{\n    app.MapGet(\"/sitemap.xml\", (SitemapXml sitemapXml) =\u003e sitemapXml.Generate());\n});\n\n```\n\nDecide on how to build up your `Classes.Utils.Sitemap` class and call it in `sitemapXml.Generate()`.  Below a `List\u003cWebPage\u003e` is used to fill the sitemap with dummy endpoints. This could be done statically like this or via a database call.\n\n\n\n\n\n```cs\nSitemap = new Classes.Utils.Sitemap();\n//Dummy data, like from a database. Dynamic pages\nList\u003cWebPage\u003e classData = new List\u003cWebPage\u003e\n{\n\tnew WebPage { Domain = \"example1.com\", Prefix = \"https\", Path = \"/path1\" },\n\tnew WebPage { Domain = \"example2.com\", Prefix = \"https\", Path = \"/path2\" },\n\tnew WebPage { Domain = \"example3.com\", Prefix = \"https\", Path = \"/path3\" }\n};\n\nforeach (var item in classData)\n{\n\tSitemap.Add(new SitemapLocation\n\t{\n\t\tChangeFrequency = SitemapLocation.eChangeFrequency.yearly,\n\t\tUrl = $\"{item.Prefix}://{item.Domain}{item.Path}\"\n\t});\n}\n\n```\n\nIt is also possible to call a list of the websites page or component endpoints.\n\n```cs\n // Get all the components which are not dynamic who have a base class of ComponentBase\n \nvar components = Assembly.GetExecutingAssembly().ExportedTypes.Where(t =\u003e typeof(ComponentBase).IsAssignableFrom(t)).ToList();\nvar routables = components.Where(c =\u003e c.GetCustomAttributes(inherit: true).OfType\u003cRouteAttribute\u003e().Any());\n\nforeach (var routable in routables)\n{\n\tSitemap.Add(new SitemapLocation\n\t{\n\t\tChangeFrequency = SitemapLocation.eChangeFrequency.yearly,\n\t\tUrl = $\"https://example3.com/{routable}\"\n\t});\n}\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpscourtney%2Fblazorserverdynamicsitemap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpscourtney%2Fblazorserverdynamicsitemap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpscourtney%2Fblazorserverdynamicsitemap/lists"}