TinySitemapGenerator 1.0.5

dotnet add package TinySitemapGenerator --version 1.0.5
NuGet\Install-Package TinySitemapGenerator -Version 1.0.5
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.5" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add TinySitemapGenerator --version 1.0.5
#r "nuget: TinySitemapGenerator, 1.0.5"
#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.5

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

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 = "https://www.mysite.com/article/tutorial.html",
        LastModified = DateTime.Now,
        Priority = SitemapPriorities.Nine,
        ChangeFrequency = SitemapChangeFrequencies.Never
    }
);

// Asychronous Methods

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

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

// 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);

// Sychronous Methods

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

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

// Get the file bytes
var bytes = sitemap.GetSitemapBytes();
File.WriteAllBytes(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 = sitemap.GetSitemapIndexBytes();
File.WriteAllBytes(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.5 257 11/26/2023
1.0.4 165 11/24/2023
1.0.3 115 11/22/2023
1.0.2 105 11/22/2023
1.0.1 104 11/22/2023

Removed depricated methods.