ParkSquare.AspNetCore.Sitemap 1.2.62

There is a newer version of this package available.
See the version list below for details.
dotnet add package ParkSquare.AspNetCore.Sitemap --version 1.2.62                
NuGet\Install-Package ParkSquare.AspNetCore.Sitemap -Version 1.2.62                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ParkSquare.AspNetCore.Sitemap" Version="1.2.62" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add ParkSquare.AspNetCore.Sitemap --version 1.2.62                
#r "nuget: ParkSquare.AspNetCore.Sitemap, 1.2.62"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install ParkSquare.AspNetCore.Sitemap as a Cake Addin
#addin nuget:?package=ParkSquare.AspNetCore.Sitemap&version=1.2.62

// Install ParkSquare.AspNetCore.Sitemap as a Cake Tool
#tool nuget:?package=ParkSquare.AspNetCore.Sitemap&version=1.2.62                

Asp.Net Core Sitemap.xml & Robots.txt Generator

Build Status

Background

This package provides automatic generation of sitemap.xml and robots.txt for ASP.NET Core application. Both of these files are considered essential for good Search Engine Optimization (SEO) and are looked upon favourably by search engines such as Google and Bing.

Save the time and hassle of manually maintaining these files, by using the ASP.NET routing tables to generate a standards-compliant sitemap file. Has configurable options to force HTTPs (all sitemap links will use the https protocol), plus Controller or Action exclusions.

Getting Started

Sitemap is implemented as ASP.NET middleware, and works by looking at all controller routes for valid pages that should be included in the xml output. By default this will only include GET verbs. If no explicit attribute is defined on your controller method, it will be assumed to be a GET.

Any requests to /sitemap.xml or /robots.txt will be handled by the Sitemap middleware. The robots file will contain a link directing robots (e.g. Googlebot) to your sitemap.

Once you have installed the Nuget package, add this line to Startup.cs to enable Sitemap:

// Place just above app.UseMvc(..)
app.UseSitemap();

Excluding Controller From Sitemap

To exclude a controller and all actions within it, such as an error or login controller, decorate the controller class with the [SitemapExclude] attribute:

// All routes in this controller will be ignored
[SitemapExclude]
public class BlahController : Controller
{
    [Route("some-route")]
    public IActionResult Something()
    {
        return View();
    }
}

Excluding Specific Actions/Routes From Sitemap

To exclude only certain actions, routes, or pages from your sitemap, decorate the action method with the [SitemapExclude] attribute:

public class BlahController : Controller
{
    [SitemapExclude]
    [Route("some-route")]
    public IActionResult Ignored()
    {
        return View();
    }

    [Route("some-other-route")]
    public IActionResult NotIgnored()
    {  
        return View();
    }
}
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp2.0 is compatible.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
8.0.4 587 6/21/2024
6.0.5 452 12/30/2023
6.0.4 180 12/15/2023
6.0.2 1,861 8/15/2023
6.0.1 3,852 6/9/2023
1.2.67 177 6/8/2023
1.2.66 1,577 9/11/2022
1.2.65 426 8/22/2022
1.2.63 402 8/19/2022
1.2.62 556 11/22/2021
1.2.59 767 5/16/2021
1.2.56 485 4/17/2021
1.0.1 864 4/17/2020
1.0.0 645 4/17/2020