Sitemap generator for Blazor.
Install Blazor.Sitemap with NuGet:
Install-Package Blazor.Sitemap
Or via the .NET Core command line interface:
dotnet add package Blazor.Sitemap
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddRazorPages();
builder.Services.AddServerSideBlazor();
var app = builder.Build();
app.UseHttpsRedirection();
app.UseStaticFiles();
app.UseRouting();
app.MapControllers();
app.MapBlazorHub();
app.MapSitemap("https://pablofrommars.github.io"); //Adjust for your url
app.MapFallbackToPage("/_Host");
app.Run();
@page "/"
@attribute [SitemapUrl(changeFreq: ChangeFreq.Daily, priority: 1.0)]
@page "/contact"
@attribute [SitemapUrl(changeFreq: ChangeFreq.Monthly, priority: 0.5)]