Skip to content

pablofrommars/Blazor.Sitemap

Repository files navigation

Blazor.Sitemap

NuGet NuGet

Sitemap generator for Blazor.

Installation

Install Blazor.Sitemap with NuGet:

Install-Package Blazor.Sitemap

Or via the .NET Core command line interface:

dotnet add package Blazor.Sitemap

Usage

Map endpoint

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();

Annotate your pages

@page "/"
@attribute [SitemapUrl(changeFreq: ChangeFreq.Daily, priority: 1.0)]
@page "/contact"
@attribute [SitemapUrl(changeFreq: ChangeFreq.Monthly, priority: 0.5)]

About

Sitemap generator for Blazor.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages