0 votes

Blend.Sitemap

This is a lightweight package that enables /sitemap.xml at the root of an umbraco website. This package is configured using appSettings.

Install in Umbraco CMS


Command Line

dotnet add package Our.Umbraco.Blend.Sitemap

Or Nuget

Install-Package Our.Umbraco.Blend.Sitemap

Setup


In the Startup.cs there is a configuration you need to add for /sitemap.xml path to render.

In the app.UseUmbraco() Under .WithEndpoints(u => add:

u.EndpointRouteBuilder.MapControllers();

This will use the route /sitemap.xml declared in the controller.

Default


If there are not any configurations in the the appSettings.json file this package will load all document types.

If there are no settings for the sitemap in the appSettings.json file nothing will be dispalyed.

Configuration


In the root of your appSettings.json you can configure custom settings. You can also use appSettings.[Environment].json to have specific settings for every environment.

"Sitemap": {
    "ExcludeBoolFieldAlias": "aliasBoolField",
    "CacheMinutes": "15"
    "ChangeFrequency": "weekly",
    "Priority": "0.5",
    "DocumentTypes: [
        {
            "Alias": "homePage",
            "ChangeFrequency": "daily"
            "Priority": "1.0"
        },
        {
            "Alias": "standardPage"
        },
        {
            "Alias": "search"
        }
    ]
}

Sitemap is the root object and is required.

Sitemap.CacheMinutes is an optional integer. When filled in the sitemap will be cached for that many minutes before rebuilding. If a document type with an alias is Published, Unpublished, Copied, Moved, Moved To Recycling Deleted, or Rolled Back the cache will be cleared and regenerated on next load. If left blank the default is 15 minutes.

Sitemap.ExcludeBoolFieldAlias is an optional string. When filled in all documents to display will use this field to determine if that document should be excluded.

Sitemap.ChangeFrequency is a required string. Options for this are alwayshourlydailyweeklymonthlyyearly, and never.

Sitemap.Priority is a required string. Options for this are 0.1 thorugh 0.9 and 1.0.

Sitemap.DocumentTypes is an optional array of document types to be in the sitemap.

DocumentType.Alias is a required string. The alias of the document type to be included in sitemap.

DocumentType.ChangeFrequency is an optional string. If not filled in will use the Sitemap.ChangeFrequency with the same options available.

DocumentType.Priority is an optional string. If not filled in will use the Sitemap.Priority with the same options available.

NuGet install instructions for Umbraco 9+

dotnet add package Our.Umbraco.Blend.Sitemap

Package owner

Chase Burandt

Chase Burandt

Chase has 76 karma points

Package Information

  • Package owner: Chase Burandt
  • Created: 16/05/2022
  • Current version 9.0.2
  • License MIT
  • Downloads on Our: 0
  • Downloads on NuGet: 109
  • Total downloads : 109

External resources