Skip to content

Simple package to generate sitemaps for your blazor application

Notifications You must be signed in to change notification settings

Tony-1992/BlazorSiteMapper

Repository files navigation

BlazorSiteMapper

===========================

NuGet version NuGet downloads

BlazorSiteMapper is a sitemap generator for Blazor applications. It helps search engines understand the structure and update frequency of your site's pages.

Features

  • Easy integration with Blazor applications.
  • Automatic sitemap generation.
  • Supports setting change frequency and priority for each page.

Usage

Install Package

dotnet add package BlazorSiteMapper

Add the following using to your Program.cs

using BlazorSiteMapper.Extensions;

Add the following to the Program.cs

builder.Services.RegisterSitemapper();

Add the following to the Program.cs above your app.Run();

app.CreateSitemap();

Once that is done, you should be able to navigate to [your-domain]/sitemap.xml and see a generated xml file with all pages you've annoted.

Annotate your pages (example)

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