Giter Club home page Giter Club logo

seo.sitemaps's Introduction

SEO.Sitemaps

  • Master
  • Develop

    Platform Platform

Search engine sitemaps.xml for EPiServer CMS 11 and Commerce 13

Description

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.

Features

  • sitemap generation as a scheduled job
  • filtering pages by virtual directories
  • ability to include pages that are in a different branch than the one of the start page
  • ability to generate sitemaps for mobile pages
  • it also supports multi-site and multi-language environments

See the editor guide for more information.

Latest release

The latest version is available on the EPiServer NuGet feed. You can find it by searching the term Geta.SEO.Sitemaps.

Download

From nuget.episerver.com feed.

How to get started?

  1. Install Sitemap plugin via NuGet in Visual Studio. Ensure that you also install the required dependencies.
  Install-Package Geta.SEO.Sitemaps
  Install-Package Geta.SEO.Sitemaps.Commerce
  1. Rebuild your solution.
  2. Configure sitemap settings and schedule the sitemap generation process. Configuration available at CMS -> Admin Mode -> Search engine sitemap settings. See the editor guide

Enabling multi language support

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>

Dynamic property for specific pages

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): Create dynamic property

and specify values for the dynamic property: Set value for the dynamic property

Adding Sitemap Properties to all content pages

Credits to jarihaa for contributing this.

[UIHint("SeoSitemap")]
[BackingType(typeof(PropertySEOSitemaps))]
public virtual string SEOSitemaps { get; set; }

Set default value

public override void SetDefaultValues(ContentType contentType)
{
    base.SetDefaultValues(contentType);
    var sitemap = new PropertySEOSitemaps
    {
        Enabled = false
    };
    sitemap.Serialize();
    this.SEOSitemaps = sitemap.ToString();
}

Ignore page types

Implement the IExcludeFromSitemap interface to ignore page types in the sitemap.

public class OrderConfirmationPage : PageData, IExcludeFromSitemap

Exclude content

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

Limitations

  • Each sitemap will contain max 50k entries (according to sitemaps.org protocol) so if the site in which you are using this plugin contains more active pages then you should split them over multiple sitemaps (by specifying a different root page or include/avoid paths for each).

Local development setup

See description in shared repository regarding how to setup local development environment.

Docker hostnames

Instead of using the static IP addresses the following hostnames can be used out-of-the-box.

QuickSilver login

Use the default [email protected] user for QuickSilver, see Installation.

Contributing

See CONTRIBUTING.md

Package maintainer

https://github.com/frederikvig

Changelog

Changelog

seo.sitemaps's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

seo.sitemaps's Issues

EPiServer7 compatibility

How can i add SEOSitemaps as a property in my model?

If i use this, then I only see an empty textbox in the admin ui.

    [Searchable(false)]
    [BackingType(typeof(PropertySEOSitemaps))]
    [Display(
        Name = "Google Sitemap",
        GroupName = GroupNames.MetaData,
        Order = 50)]
    public virtual string SEOSitemaps { get; set; }

Sitemap.xml file not created in root of website

Hi,

I am having issues getting the sitemap.xml file created in my root EPiServer 7.18 instance. I have everything configured properly in the "Search engine sitemap settings" admin screen and when I run the job everything completes successfully with 388 entries. When I peruse for the sitemap file it doesn't exist. I searched the entire drive without any luck.

I have tried both the Nuget package and the Git source repo added to my solution. No errors listed in the EPi logs either. For giggles I added the following line in the SitemapXmlGenerator.cs file to see if I could get something to write out to the filesystem.

doc.Save(this.SitemapData.Host);

When I run this locally the file is created successfully in the c:\program files (x86)\IISExpress directory. When this code is run from a development server the file tries to write to c:\windows\system32\inetsrv\ directory (Access is denied).

Any help is greatly appreciated.

Scheduled job ends with error

Create new sitemap with all default settings for root page (-1).

Job ends with:
Object reference not set to an instance of an object.

Scheduled job runs successfully, but 0 entries

We have the sitemap on our site, and the job runs and creates a sitemap with entries on my environment. On all our test and production environments the job runs successfully, but create no entries.

Wrong URL rendered in output

Hi,

When we render the sitemap for our client the element is rendered as follows:
https://shop.beterbed.nl/beterbed/boxsprings/box-cordoba-vlak-131d1a56/
The URL should be:
https://shop.beterbed.nl/boxsprings/vlakke-boxsprings/box-cordoba-vlak/?variationCode=474153
This is not the correct URL. How can we change this?

Thanks!

/Mark

Question : Error creating sitemap for "sitemap.xml"

Hello,

I have recently upgraded my EPiServer framework to 9.12.2, and installed the sitemap via nuget
I have set the root as -1, However when I run the task, I keep on getting this message ,
" Job successfully executed.
Generated sitemaps:
Error creating sitemap for "sitemap.xml" " . How do i debug this error?
I have tried checking write permission to the wwwroot folder, which looks fine to me. What else could be going wrong here?

Unclear License Status

First of all, fantastic tool - best of its type I've seen. I'd love to use this in a client project, but in the absence of any visible license (MIT, GPL, etc), am unable to do so.

Could you advise on the license status of this project, and ideally add a license.txt to the repository? Cheers!

problem with multiple sites sitemap

I have a small issue when running 2 sites (for example .nl and .com).

steps to reproduce:

  • Create a sitemap for each of the two sites (each sitemap is named sitemap.xml).
  • Run the scheduled task to create the sitemaps.

Then when requesting the page www.example.com/sitemap.xml the result is empty or equal to the other site www.example.nl/sitemap.xml.
This seems like a bug to me.

For now i'm using a workaround.

This workaround is to place one sitemap.xml in a directory, like www.example.com/com/sitemap.xml. Then recreate the sitemaps in the scheduled task.

Is there a way to extend the sitemap.xml list?

Why i ask: For our client we have a couple of integrations with systems and we have virtual pages. (from xml feed). So those pages are not in the CMS tree, but we would like to add(append) them to the current generated sitemap.xml... could we hook into this some way?

Commerce products are not in XML

I am not sure if I missed anything, how do I configure in Search engine sitemap settings?

p.s. I am using the latest EPi Commerce

Thanks,
Vincent

How do I enable the Language dropdown?

Hi,
I would like to use the language and language fallback settings that you have in you plugin, but I cant find where to enable this?

The only way I find right now is to set it to true in AdminManageSitemap.aspx, but It would be nice to have a setting for it in admin mode so that it wont get overridden when updating the nuget package.

Thanks!
/Mia

Error while creating sitemap

Hi,

I've installed version 1.5.7 for Episerver 9 and when I try to create a sitemap for standard and products I get the following error:
Activation error occurred while trying to get instance of type ICommerceAndStandardSitemapXmlGenerator, key "" [No default Instance is registered and cannot be automatically determined for type 'Geta.SEO.Sitemaps.XML.ICommerceAndStandardSitemapXmlGenerator' There is no configuration specified for Geta.SEO.Sitemaps.XML.ICommerceAndStandardSitemapXmlGenerator 1.) Container.GetInstance(Geta.SEO.Sitemaps.XML.ICommerceAndStandardSitemapXmlGenerator) ]
No error when creating a standard sitemap though.

Hope anyone can help!

Thanks,

Mark

Support for EPiServer 9

Since EPiServer.BaseLibrary.dll has been removed in EPiServer 9 and there is a reference to it in Geta.SEO.Sitemaps, the EPiServer site cant be loaded with Geta.SEO.Sitemaps.

404 error on the generated XML

Hi,

I have install the Geta.Seo.Sitemap in my project, after installation we are getting some issue when generate sitemap. It seems all xml is created when running the sitemap job but when you click on url it give 404 error.

Following is the structure of our site

XYZ_PublicWeb -- In manage Website, and under that we have all the language domain

www.xyz.com

www.xyz.ae

www.xyz.zh

www.xyz.fr

etc

In Serach engine sitemap Settings tools, we define domain as

www.xyz.com/en/sitemap.xml

www.xyz.ae/ae/sitemap.xml

www.xyz.zh/zh/sitemap.xml

www.xyz.fr/fr/sitemap.xml

language is add in url becasue we selected language in each domain while creating sitemap.

Thanks in Advance

Priority is always 1.0 on all pages - v1.4.2

Hi,

I have version 1.4.2 and I couldn't upgrade to 1.5.1 because it's dependent on EPiServer 9 which my project is not ready to take on yet. The sitemaps are generated fine but all pages have priority of 1. When I looked at the latest source code that calculates the priority, I could see in the class SitemapXmlGenerator.cs the following code:

int depth = new Uri(url).Segments.Length - 1;
return Math.Max(1.0 - (depth / 10.0), 0.5).ToString(CultureInfo.InvariantCulture);

The logic looks correct as it considers the depth, but in 1.4.2 it seems to be not. How can I grab the source code of 1.4.2 so I can change the code manually and use this in my solution?

Thanks,
Nicola

Scheduled job and admin plugin on EPiServer 7

When installing the NuGet package, first time I run the scheduled job afterwards it immediately says: "Job successfull. Generated sitemaps:", I then have to run the job again to actually generate the sitemap.xml: Job successfull. "Generated sitemaps:
"sitemap.xml": 128 entries".

Second issue is that when clicking "Edit" on the admin plugin I get ArgumentOutOfRangeException. Length cannot be less than zero. <asp:TextBox runat="server" ID="txtHost" Text='<%# GetHostNameEditPart(Eval("Host").ToString()) %>' /><%= SitemapHostPostfix %>

Issue with Geta.SEO.Sitemap.Commerce

I am trying to use Geta.SEO.Sitemap.Commerce for creating a sitemap for commerce/catalog. For this I am running the scheduled job from the admin panel. It creates the sitemap for CMS and Commerce successfully. At the end of the job it creates the sitemap for CMS with some entries but creates 0 entries for commerce. Permissions should not be an issue here as I am logged in as an admin. And also tried to add a wildcard (*) as described in another issue here. Please help us setting up a commerce sitemap.
Thanks.

Cant access xml

Hi.
Im currently on Episerver 7.5 with a WebForms-project and i cant access the generated xml.
I can view the xml through the viewbutton in admin-mode("Search engine sitemap settings") but when i try to access the xml through the host-url i get "No parameterless constructor defined for this object.".

What have i done wrong?
untitled

Search engine sitemap settings keeps adding AdminManageSitemap.aspx to the URL

Hi Team,

After generating sitemap when we access AdminManageSitemap.aspx page, after clicking to view click on any link on the page, and the page name (AdminManageSitemap.aspx) will be added to the page URL:
until it's repeated many times, like http://mysite.com/Modules/Geta.SEO.Sitemaps/AdminManageSitemap.aspx/AdminManageSitemap.aspx/AdminManageSitemap.aspx/AdminManageSitemap.aspx/AdminManageSitemap.aspx/AdminManageSitemap.aspx/AdminManageSitemap.aspx/AdminManageSitemap.aspx
and at some point the URL exceeds the characters limit and a 404 page is displayed.

Kindly help us to resolve the issue asap.

Regards,
Chandrakant H

Tool crahses on Add New Sitemap

After updating to the 1.6.4 Epi tool started to crash on pressing Add New Sitemap button.

Looks like the AntiForgery token causes this issue

Does not respect Accept-Encoding header

The module always output gzip encoding, no matter what encoding the client has specified as acceptable. This is a violation of the HTTP W3 spec, which states:

If an Accept-Encoding field is present in a request, and if the server cannot send a response which is acceptable according to the Accept-Encoding header, then the server SHOULD send an error response with the 406 (Not Acceptable) status code.
If no Accept-Encoding field is present in a request, the server MAY assume that the client will accept any content coding. In this case, if "identity" is one of the available content-codings, then the server SHOULD use the "identity" content-coding, unless it has additional information that a different content-coding is meaningful to the client.

I could supply a PR to check for the header before adding the Response.Filter?

Failing test:

curl -H "Accept-Encoding: foo" -I https://meny.no/sitemap.xml

Sitemap.xml isn't generated at the root folder

Hi,

I am having issues getting the sitemap.xml file created in my root.
When I run the job everything completes successfully and if i click the view option from admin I do see the pages.
When I look for the sitemap file it doesn't exist. I searched the drive without any luck. I have also checked that i have write permission to the root folder.

Pages from custom content provider not listed in site map

We are using a custom content provider which programmatically adds pages to the EpiServer content tree on startup, based on data from an external database. EpiServer Find indexes these pages, but somehow SEO.Sitemaps does not add these pages to the generated sitemap. What can I do to have these pages added to the sitemap?

Problem with multiple languages on EPiServer 7.5

When generating sitemaps on an EPiServer 7.5 site, the job only generates sitemaps for the site that matches the value ContentLanguage.PreferredCulture. I decompiled the code and debugged it and the problem is in the PageFilter.ShouldExcludePage() method.

When doing page.IsVisibleOnSite() it returns false for Swedish pages because the above mentioned ContentLanguage.PreferredCulture is set to "en".

I can't see a logical place to put a ContentLanguage.PreferredCulture = new CultureInfo(..) otherwise I would make a PR.

Assembly does not have a strong name

On the EPI project that I'm currently working on, all assemblies are signed with a strong name during build. The Geta.SEO.Sitemaps.dll does not seem to have a strong name attached to it, so I can't use it.

Can you please sign your assemblies before publishing them?

Route customisation multi language is used

Hi,

Is it possible to customize the language segment that is generated by the tool when multi-language is used?

In my case the following url returns a 404, I guess it get's picked up by EPiServer routing
/en-us/Sitemap.xml
The sitemap gets generated since I can see it with the View link.

Thanks in advance, great tool BTW.

Radu

http / http bug in the GetSiteHosts method

If the main site (in website url settings in admin) is http, but a subsite has https (or the other way around) the schema for the sitemap is set wrong. In the GetSiteHosts method the website url schema settings is used and not the host name schema.

https://github.com/Geta/SEO.Sitemaps/blob/master/Geta.SEO.Sitemaps/Modules/Geta.SEO.Sitemaps/AdminManageSitemap.aspx.cs (line 351)

var schema = "http";
if (host.UseSecureConnection != null && host.UseSecureConnection == true)
{
schema = "https";
}

404 Error while opening the Tools->Search Engine Sitemap Settings

We are using 10th version of EPiServer Commerce.

When the application is deployed on the Test server - it is not possible to open the Tools->Search Engine Sitemap Settings. The url is like Modules/Geta.SEO.Sitemaps/AdminManageSitemap.aspx

It simply throws 404 without saying anything in the log.

Do you have some workarounds or ideas for such cases?

Locally the same code works just fine.

Setting default value on specific page types

Is there a way to set the SEOSitemaps property to be disabled on specific pagetypes? I have tried setting the serialized string value of the property in the get method but it doesn't use that value it seems.

This is what I have tried

public virtual string SEOSitemaps {
            get
            {
                var sitemapSetting = this.GetPropertyValue(x => x.SEOSitemaps);
                if (this.PageTypeName == "InformationPage")
                {
                    return string.IsNullOrWhiteSpace(sitemapSetting) ? "<SEOSitemaps><enabled>False</enabled><changefreq>weekly</changefreq><priority>0.5</priority></SEOSitemaps>" : sitemapSetting;
                }
                return sitemapSetting;
            }
            set
            {
                this.SetPropertyValue(b => b.SEOSitemaps, value);
            }
        }

404 for AdminManageSitemap.aspx

Hello!

We experience an issue right now where Modules/Geta.SEO.Sitemaps/AdminManageSitemap.aspx results in a 404. Episerver.CMS 9.7.1 and latest version of Sitemaps.

Error occured 6/14/2016 3:42:39 PM
User IP 127.0.0.1
User Agent Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.84 Safari/537.36
Url http://urlremovedforprivacyreasons/Modules/Geta.SEO.Sitemaps/AdminManageSitemap.aspx
Referer (none)
Exception details: HttpException: Not Found
Http status: 404 NotFound
Stack trace:

[HttpException: Not Found]

Have you experienced something similar?

We are having trouble understanding what causes the problem. I've debugged the code in the code behind file and it all seems to work OK. The problem seems to be related to SimplePage. I tried creating a new aspx-file in the modules-folder. The page works fine util i change it to inherit simple page. Then it also results in a 404.

log4net version

Steps to reproduce:
0) Add SEO.Sitemaps to CMS6R2 project using nuget. My project uses libraries with references to log4net v1.2.10.0
When I'm trying to start 'Generate search engine sitemaps' (EPiServer.UI, Version=6.1.379.0, Culture=neutral, PublicKeyToken=8fe83dea738b45b7)

  1. Configure and manually start job 'Generate search engine sitemaps'

Actual result:
The job failed: Could not load file or assembly 'log4net, Version=1.2.11.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Expected result:
sitemap is generated

Comments: I think I found out the reason: the log4net you have refenrenced (v2.0.0.0) really refers to a log4net v1.2.11.0 which for some reason was signed (by Apache) using different key, so web.config cannot be properly updated with assemblyBinding because PublicKeyToken differs for 1.2.10 and 1.2.11.

Maybe it's possible to remove the log4net reference in your nuget package?

Is 1.5 backwards compatible with EpiServer 7

We are currently using version 1.1.2.0 in our EpiServer 7 site. I see that this version used ScheduledJobBase, which is not included in Epi 7. Would this mean that we cannot upgrade to this version until we run Epi 9 or later?

Extend/Add additional site map generators

We need to create a scheduled job that generates a html sitemap. Basically what this plugin does, but with different output format. After looking into this code, I found that I would be duplicating a lot of the existing effort put into this plugin. So I was wondering if there was a way of extending this solution with my own SiteMap?

I would need to

  • add a custom route
  • add a custom "OutputProcessor"

Is there a way of doing this without modifying the plugin code?

PropertySEOSitemaps for commerce sitemap

Is it possible to add the PropertySEOSitemaps to commerce products?
I need to set the priority for all products to 0.2, i am using your version 1.4.1 because i am running EPiServer 8.x.

Error creating sitemap in EPiServer 7 MVC website

I'm trying to get this (version 1.1.1.0) to work in an Epi7 MVC website.

The scheduled job throws the following exception when I run the job.
Is there something i'm missing here?

2013-08-23 10:39:11,130 [6] ERROR Geta.SEO.Sitemaps.Services.SitemapService: Error on generating xml sitemap
System.ArgumentNullException: Value cannot be null.
Parameter name: uriString
at System.Uri..ctor(String uriString)
at Geta.SEO.Sitemaps.Utils.SitemapContentHelper.GetSitemapXmlElements(SitemapData sitemapData, ISitemapXmlGenerator sitemapGenerator, ISet`1 urlSet)
at Geta.SEO.Sitemaps.Utils.SitemapContentHelper.CreateSitemapXmlContents(SitemapData sitemapData, Int32& entryCount)
at Geta.SEO.Sitemaps.Services.SitemapService.Generate(SitemapData sitemapData, Int32& entryCount)

404 on sitemap.xml when there is one site and multple domains and langauge branches

If you have one site in EPiServer with multple domains mapped to different langauge branches you get 404 on all domains except the primary one.

website.no --> language branch no -- > sitemap.xml is ok but contains all pages. should only contain pages from no branch
website.se --> language branch sv --> sitemap.xml returns 404. should return sitemap.xml with pages from sv branch
website.dk --> language branch da --> sitemap xml return 404. should return sitemap.xml with pages from da branch

Is my approach wrong or is there some missing functionallity?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.