New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Sitemaps #42

Closed
juan-manuel-alberro opened this Issue May 2, 2017 · 10 comments

Comments

Projects
None yet
4 participants
@juan-manuel-alberro
Contributor

juan-manuel-alberro commented May 2, 2017

Hello all,

It's a general question instead of a bug, is Posteaf generating the sitemap.xml file or there's an endpoint for that e.x. /sitemap ?

If don't, any plans to add it into the alpha version? I believe this is a very important feature since Postleaf is SEO friendly.

Thanks.

@claviska

This comment has been minimized.

Member

claviska commented May 2, 2017

@lukewatts

This comment has been minimized.

lukewatts commented May 2, 2017

For the time being you can use sitemap generators such as XML Sitemaps

I would say this is best left to plugins so SEO specialists can implement this functionality and maintain it separately. SEO is a ever changing so maintaining changes in core could be a pain. Just my opinion

@juan-manuel-alberro

This comment has been minimized.

Contributor

juan-manuel-alberro commented May 2, 2017

IMHO a sitemap generation is a core functionality in every CMS.
We can implement something like this https://www.npmjs.com/package/sitemap, it will create a new endpoint for the sitemap and that's it.

@claviska claviska changed the title from [Question] How to create a sitemap? to Support for Sitemaps May 2, 2017

@claviska claviska added the Feature label May 2, 2017

@claviska

This comment has been minimized.

Member

claviska commented May 2, 2017

I'm not worried about how to implement it on the technical side. I need to know what a sitemap should look like for 99% of sites to determine if it really belongs in core.

If there's a standardized, unopinionated way to create them, let's do it. If implementation varies wildly based on individual preference, it probably belongs in a plugin.

I'm not going to get into an argument over SEO best practices here. If that's the case, the feature is likely too opinionated to add to core. Right now, Postleaf already supports JSON-LD, OpenGraph, and Twitter Cards and none of my sites have trouble indexing things. 🤷‍♂️

@claviska claviska modified the milestone: 1.0.0-alpha.5 May 8, 2017

@claviska

This comment has been minimized.

Member

claviska commented May 8, 2017

Ghost's implementation looks like this: https://blog.ghost.org/sitemap.xml

They're using sitemap.xml as an index with the following groups:

sitemap-pages.xml
sitemap-posts.xml
sitemap-authors.xml
sitemap-tags.xml

What's better for a Postleaf website? All posts/pages in sitemap.xml or multiple sitemaps like mentioned above?

@juan-manuel-alberro

This comment has been minimized.

Contributor

juan-manuel-alberro commented May 8, 2017

I thinks there's no a better approach over this, many Wordpress plugins manage a single sitemap_index.xml with other sitemaps inside like Ghost. I like this implementation and the Protocol doesn't say anything about better practices.

@claviska claviska added this to the 1.0.0-alpha.5 milestone May 8, 2017

@claviska

This comment has been minimized.

Member

claviska commented May 10, 2017

Is there a benefit to separate the sitemap into multiple categories like I mentioned above, or would a single sitemap be fine? Does it affect how search engines index the site at all?

@juan-manuel-alberro

This comment has been minimized.

Contributor

juan-manuel-alberro commented May 11, 2017

I believe there's no benefit to split the sitemaps in different files except the one that it's easier to read for humans. Here's an example of a full sitemap with everything in the same file.

@karsasmus

This comment has been minimized.

Contributor

karsasmus commented May 11, 2017

Max. entries of a single sitemap.xml: 50k
Max. size of a single sitemap.xml: 10 MB
It's possible to gzip a sitemap, so the max. size is also 10 MB.

It's possible to have one sitemap.xml which links to other sitemap.xml files.
So it's possible to have 50k x 50k entries.

Hope that helps a little bit.

@claviska claviska closed this in 6449441 May 11, 2017

@claviska

This comment has been minimized.

Member

claviska commented May 11, 2017

Thanks, @karsasmus.

As of 6449441, Postleaf generates a single-page sitemap automatically. The sitemap is accessible at /sitemap.xml and rendered via /source/views/sitemap.dust. I've also added a reference to it in robots.dust (used to render robots.txt).

Like robots.dust, this template doesn't have to exist in your theme, but you can override it by including one. This gives users the ability to customize their sitemap if the default isn't acceptable for some reason.

Pages included in the sitemap (with priority):

  • homepage (1.0)
  • pages (0.8)
  • posts (0.8)
  • authors (0.6)
  • tags (0.6)

I don't see many users hitting 50,000 posts or the XML file being larger than 10MB. It's probably inevitable that someone will, but that edge case can be handled down the road.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment