Search engine sitemaps.xml for EPiServer CMS 11 and Commerce 13
This tool allows you to generate xml sitemaps for search engines to better index your EPiServer sites. Although there are several EPiServer sitemap tools available like SearchEngineSitemaps and EPiSiteMap which have inspired this project this tool gives you some additional specific features.
See the editor guide for more information.
The latest version is available on the EPiServer NuGet feed. You can find it by searching the term Geta.SEO.Sitemaps.
From nuget.episerver.com feed.
Install-Package Geta.SEO.Sitemaps
Install-Package Geta.SEO.Sitemaps.Commerce
Add this to your web.config file:
<configuration>
<configSections>
<section name="Geta.SEO.Sitemaps" type="Geta.SEO.Sitemaps.Configuration.SitemapConfigurationSection, Geta.SEO.Sitemaps"/>
</configSections>
<Geta.SEO.Sitemaps>
<settings enableLanguageDropDownInAdmin="true" />
</Geta.SEO.Sitemaps>
</configuration>
You can specify page specific sitemap properties (like change frequency, priority or include/disinclude the specific page in any sitemap) for each EPiServer page by defining a dynamic property with type SEOSitemaps (and the same name):
and specify values for the dynamic property:
Credits to jarihaa for contributing this.
[UIHint("SeoSitemap")]
[BackingType(typeof(PropertySEOSitemaps))]
public virtual string SEOSitemaps { get; set; }
public override void SetDefaultValues(ContentType contentType)
{
base.SetDefaultValues(contentType);
var sitemap = new PropertySEOSitemaps
{
Enabled = false
};
sitemap.Serialize();
this.SEOSitemaps = sitemap.ToString();
}
Implement the IExcludeFromSitemap
interface to ignore page types in the sitemap.
public class OrderConfirmationPage : PageData, IExcludeFromSitemap
If you need more control to exclude content from the sitemap you can make your own implementation of IContentFilter. Make sure to inherit from ContentFilter and call the ShouldExcludeContent
method of the base class.
public class SiteContentFilter : ContentFilter
{
public override bool ShouldExcludeContent(IContent content)
{
if (base.ShouldExcludeContent(content))
{
return true;
}
// Custom logic here
return false;
}
}
Register in your DI container.
services.AddTransient<IContentFilter, SiteContentFilter>();
See description in shared repository regarding how to setup local development environment.
Instead of using the static IP addresses the following hostnames can be used out-of-the-box.
Use the default admin@example.com user for QuickSilver, see Installation.
See CONTRIBUTING.md
https://github.com/frederikvig