Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Support for Sitemaps #42

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

Support for Sitemaps #42

juan-manuel-alberro opened this issue May 2, 2017 · 10 comments
Labels
Milestone

Comments

@juan-manuel-alberro
Copy link
Contributor

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
Copy link
Member

claviska commented May 2, 2017 via email

@lukewatts
Copy link

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
Copy link
Contributor Author

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 [Question] How to create a sitemap? Support for Sitemaps May 2, 2017
@claviska
Copy link
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
Copy link
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
Copy link
Contributor Author

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
Copy link
Member

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
Copy link
Contributor Author

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
Copy link
Contributor

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
Copy link
Member

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 subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants