Friendly Sitemap makes adding a dynamic sitemap.xml
file to your Umbraco 8 website easy!
This package is supported on Umbraco 8.1+.
Friendly Sitemap is available from Our Umbraco, NuGet, or as a manual download directly from GitHub.
You can find a downloadable package on the Our Umbraco site.
To install from NuGet, run the following command in your instance of Visual Studio.
PM> Install-Package Our.Umbraco.FriendlySitemap
Once installed, the sitemap will be visible on the URL /sitemap.xml
, such as https://www.yoursite.com/sitemap.xml
. The items disaplayed in the sitemap will be specific for the current domain.
If a physical sitemap.xml
file exists in your website, the dynamically generated sitemap will be disabled.
It is possible to disable the sitemap via the appsettings section of your web.config
file should you need to.
<add key="Umbraco.Sitemap.EnableSitemap" value="false" />
By default the sitemap will include all content items within a current site that have a template assigned.
Adding a true / false (boolean) property to any doctype with the alias sitemapExclude
makes it possible to hide specific items from the sitemap.
All of the XML Sitemap v0.9 tag definitions can be supported by adding properties with specific aliases to any doctype:
Attribute | Property alias |
---|---|
url | url |
lastmod | updateDate |
changefreq | sitemapChangeFreq |
priority | sitemapPriority |
It is possible to override the default configuration of the package using dependency injection, by registering a new instance of SitemapConfiguration
within an IUserComposer
class.
This is helpful for advanced configuration needs, such as defining unique settings per site in a multi-site Umbraco installation.
Here's an example:
using Our.Umbraco.FriendlySitemap.Startup;
[Disable(typeof(SitemapComposer))]
public class CustomSitemapComposer : IUserComposer
{
public void Compose(Composition composition)
{
composition.Register(factory => GetConfiguration(), Lifetime.Request);
}
private SitemapConfiguration GetConfiguration()
{
var configuration = new SitemapConfiguration
{
EnableSitemap = true
};
return configuration;
}
}
To raise a new bug, create an issue on the GitHub repository. To fix a bug or add new features, fork the repository and send a pull request with your changes. Feel free to add ideas to the repository's issues list if you would to discuss anything related to the library.
This project is maintained by Callum Whyte and contributors. If you have any questions about the project please get in touch on Twitter, or by raising an issue on GitHub.
The package logo uses the Sitemap icon from the Noun Project by Adrien Coquet, licensed under CC BY 3.0 US.
Copyright © 2019 Callum Whyte, and other contributors
Licensed under the MIT License.