TinySitemapGenerator 1.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package TinySitemapGenerator --version 1.0.3                
NuGet\Install-Package TinySitemapGenerator -Version 1.0.3                
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="TinySitemapGenerator" Version="1.0.3" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TinySitemapGenerator --version 1.0.3                
#r "nuget: TinySitemapGenerator, 1.0.3"                
#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 TinySitemapGenerator as a Cake Addin
#addin nuget:?package=TinySitemapGenerator&version=1.0.3

// Install TinySitemapGenerator as a Cake Tool
#tool nuget:?package=TinySitemapGenerator&version=1.0.3                

TinySitemapGenerator

Author: Ryan Kueter
Updated: November, 2023

About

TinySitemapGenerator is a free .NET library available from the NuGet Package Manager that provides a simple way to create a sitemap or a sitemap index for your website.

Targets:

  • .NET 8

Introduction

The TinySitemapGenerator provides the following options for automatically generating an XML sitemap.

// Create a new sitemap
var sitemap = new Sitemap();

// Optionally add the xsd reference for validation
sitemap.ValidateMap = true;

// Specify the file path
sitemap.Filepath = @"C:\wwwroot";

// Add optional namespaces
sitemap.SitemapOptionalNamespaces.Add(SitemapOptionalNamespace.News);

// Add Sitemap Urls
sitemap.SitemapUrls.Add(
    new SitemapUrl { 
        Location = "www.mysite.com/article/tutorial.html",
        LastModified = DateTime.Now,
        Priority = SitemapPriorities.Nine,
        ChangeFrequency = SitemapChangeFrequencies.Never
    }
);

// Generate a standard XML sitemap
sitemap.DownloadSitemap();

// Generate a XML sitemap index because
// you have more than 50,000 urls or your
// files exceed 50MB
sitemap.DownloadSitemapIndex();

// Generate a standard XML sitemap
await sitemap.DownloadSitemapAsync();

// Generate a XML sitemap index because
// you have more than 50,000 urls or your
// files exceed 50MB
await sitemap.DownloadSitemapIndexAsync();

// Get the file bytes
var bytes = await sitemap.GetSitemapBytesAsync();
await File.WriteAllBytesAsync(Path.Combine(@"C:\wwwroot", "sitemap.xml"), bytes);

// Generate a XML sitemap index because
// you have more than 50,000 urls or your
// files exceed 50MB
var bytes = await sitemap.GetSitemapIndexBytesAsync();
await File.WriteAllBytesAsync(Path.Combine(@"C:\wwwroot", "sitemap.xml"), bytes);

Contributions

This project is being developed for free by me, Ryan Kueter, in my spare time. So, if you would like to contribute, please submit your ideas on the Github project page.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on TinySitemapGenerator:

Package Downloads
Tazor

Tazor is a NuGet package that seamlessly integrates Blazor Components to provide a dynamic and interactive static site generation solution. This allows you to harness the power of C# and the Blazor framework for building static websites with engaging user interfaces.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.0.6 83 12/5/2024
1.0.5 366 11/26/2023
1.0.4 261 11/24/2023
1.0.3 143 11/22/2023
1.0.2 134 11/22/2023
1.0.1 133 11/22/2023

Breaking changes include removed old xml generation methods and replaced them with the following methods: DownloadSitemap(), DownloadSitemapIndex(), DownloadSitemapAsync(), DownloadSitemapIndexAsync(), GetSitemapBytesAsync(), and GetSitemapIndexBytesAsync(). Also omitted xml elements that contain empty strings.