setup-blazor-sitemaps
Installation
SKILL.md
Set up / configure sitemaps in Blazor
Target .NET 10 server-hosted Blazor. Use namespace PinguApps.BlazorSitemap. The package discovers compiled RouteAttribute metadata; it does not scan deployed Razor source or render pages. Standalone WebAssembly requires a hosting endpoint or deployment-generated sitemap. Server trimming/Native AOT is unsupported; normal Auto client trimming is supported.
Install and register
- Server:
PinguApps.BlazorSitemap. Its dependency brings Abstractions transitively. - Each referenced client/Razor library containing included routable components: explicitly reference
PinguApps.BlazorSitemap.Abstractionsfor attributes and source-tracking assets. Do not require the server package in the browser. - Configure
Sitemap:PublicBaseUrlusing normal ASP.NET Core configuration. Preferdotnet user-secrets initanddotnet user-secrets set "Sitemap:PublicBaseUrl" "http://localhost:5187"in the server project for Development. User Secrets are automatically loaded byWebApplication.CreateBuilderonly in Development. Supply production settings through appsettings, environment variables (Sitemap__PublicBaseUrl) or deployment configuration. Command-line overrides also work. - Set the actual trusted public HTTP(S) origin and optional mount, never incoming Host headers. Credentials, query, fragment, whitespace and backslashes are invalid in the base.