TinySitemapGenerator 1.0.3
See the version list below for details.
dotnet add package TinySitemapGenerator --version 1.0.3
NuGet\Install-Package TinySitemapGenerator -Version 1.0.3
<PackageReference Include="TinySitemapGenerator" Version="1.0.3" />
paket add TinySitemapGenerator --version 1.0.3
#r "nuget: TinySitemapGenerator, 1.0.3"
// 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 | Versions 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. |
-
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.
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.