![]() |
VOOZH | about |
dotnet add package cloudscribe.Web.SiteMap --version 10.0.0
NuGet\Install-Package cloudscribe.Web.SiteMap -Version 10.0.0
<PackageReference Include="cloudscribe.Web.SiteMap" Version="10.0.0" />
<PackageVersion Include="cloudscribe.Web.SiteMap" Version="10.0.0" />Directory.Packages.props
<PackageReference Include="cloudscribe.Web.SiteMap" />Project file
paket add cloudscribe.Web.SiteMap --version 10.0.0
#r "nuget: cloudscribe.Web.SiteMap, 10.0.0"
#:package cloudscribe.Web.SiteMap@10.0.0
#addin nuget:?package=cloudscribe.Web.SiteMap&version=10.0.0Install as a Cake Addin
#tool nuget:?package=cloudscribe.Web.SiteMap&version=10.0.0Install as a Cake Tool
ASP.NET Core MVC controller and models for generating a SiteMap for search engines. Submitting a sitemap to the major search engines is vital to the SEO of most web sites.
👁 Join the chat at https://gitter.im/joeaudette/cloudscribe
This was implemented in support of my cloudscribe SimpleContent project but has no dependencies on other cloudscribe projects and could be useful for many website projects.
What is currently provided is an mvc controller at /api/sitemap that can generate the xml sitemap from 1 or more IEnumerable<ISiteMapNode>. To use it in your own project you would implement ISiteMapNodeService which has one method, GetSiteMapNodes which returns an IEnumerable<ISiteMapNode>. You can register one or more implementations of ISiteMapNodeService with DI services and the controller will iterate through each of them to build the sitemap. There is also support for memory caching, but support for distributed cache has not been implemented yet.
Note that this project does not currently provide a sitemap solution for very large sites. A single sitemap which this project can generate dynamically, can only have up to 25,000 urls. If you have more that that you would need a differenet solution that generates a sitemap index which is a list of sitemap urls where each of the separate sitemaps can have up to 25,000 urls, and you can have up to 50,000 sitemaps listed in the index. I think if I were needing sitemaps that large I would create a process to generate the files as static xml files and serve those directly rather than generating the sitemap dynamically as in this project.
Prerequisites:
To install from nuget.org open the project.json file of your web application and in the dependencies section add:
"cloudscribe.Web.SiteMap": "1.0.0-*"
Visual Studio 2015 should restore the package automatically, you could also open a command prompt and use dnu restore in your project folder.
In your Startup.cs you will need this at the top:
using Microsoft.Framework.DependencyInjection.Extensions;
using cloudscribe.Web.SiteMap;
and in ConfigureServices you will need this:
services.AddScoped<ISiteMapNodeService, YourImplementationOfSiteMapNodeService>();
You will also need to define a cache profile named SiteMapCacheProfile as part of the MVC configuration like this:
services.Configure<MvcOptions>(options =>
{
options.CacheProfiles.Add("SiteMapCacheProfile",
new CacheProfile
{
Duration = 6000 //in seconds
});
});
services.AddMvc();
Follow me on twitter @cloudscribeweb and @joeaudette
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
Showing the top 3 NuGet packages that depend on cloudscribe.Web.SiteMap:
| Package | Downloads |
|---|---|
|
cloudscribe.Web.SiteMap.FromNavigation
cloudscribe.Web.SiteMap.FromNavigation a library that implements ISiteMapNodeService using existing tree of nodes from cloudscribe.Web.Navigation.NavigationTreeBuilderService |
|
|
BioEngine.Core.Site
Package Description |
|
|
cloudscribe.SimpleContent.Web.Mvc
MVC Controllers for cloudscribe.SimpleContent.Web |
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 10.0.0 | 511 | 4/7/2026 |
| 8.7.0 | 1,302 | 3/2/2026 |
| 8.6.0 | 1,432 | 11/19/2025 |
| 8.5.0 | 1,472 | 9/22/2025 |
| 8.4.0 | 948 | 8/21/2025 |
| 8.3.0 | 1,215 | 7/23/2025 |
| 8.2.0 | 1,061 | 7/9/2025 |
| 8.1.0 | 1,450 | 5/1/2025 |
| 8.0.0 | 3,931 | 8/5/2024 |
| 6.0.0 | 32,852 | 4/22/2022 |
| 5.0.0 | 12,336 | 11/26/2021 |
| 4.1.1 | 10,055 | 1/28/2021 |
| 4.1.0 | 35,827 | 8/14/2020 |
| 4.0.1 | 138,413 | 10/19/2019 |
| 4.0.0 | 21,551 | 9/28/2019 |
| 4.0.0-preview20190831 | 1,591 | 9/1/2019 |
| 3.0.0-preview20190831 | 940 | 8/31/2019 |
| 2.1.4 | 213,183 | 3/3/2019 |
| 2.1.3 | 10,660 | 2/15/2019 |
| 2.1.2 | 234,346 | 10/9/2018 |