Socket
Book a DemoInstallSign in
Socket

cloudscribe.Web.SiteMap

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cloudscribe.Web.SiteMap

ASP.NET Core controller and models for generating an xml sitemap for search indexes http://www.sitemaps.org

8.4.0
Source
nugetNuGet
Version published
Maintainers
2
Created
Source

cloudscribe.Web.SiteMap

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. To use it in your own project you would implement ISiteMapNodeService which has one method, GetSiteMapNodes which returns an IEnumerable. 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.

Installation

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

Keywords

cloudscribe

FAQs

Package last updated on 21 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.