[Feature] Generate sitemap.xml
[Updated 26 Jul 2014 - John]
To support SEO, Ghost should generate a sitemap.xml.
The best format for this is likely to follow the work of Yoast and his SEO plugin for WordPress, which creates separated XML sitemaps for different content formats, brought together in a main XML file and served through an XSL template. This has been widely tested and updated over the years.
Demo: http://marketplace.ghost.org/sitemap.xml
For us the sitemap structure would be:
- Index
- Posts
- Pages (contains home)
- Tags
- Authors
These should be generated once and saved in the filesystem. When a post is published or updated it should update the posts sitemap, when a page is published or updated it should update the pages sitemap, when a user is created or updated... and so on.
+1, but this is a little way off
I know, just wanted to note it down. You can assign it to milestone 0.far_far_away.
@JohnONolan: Mind if I work on this one?
Probably using sitemap.js ( https://github.com/ekalinin/sitemap.js ) it would be a fast thing to do quite similar to RSS handler, without pagination.
I think it's not worth adding a new dependency for this. Sitemaps are easy enough to generate with just a few lines of code.
@halfdan I think for now it's probably better to focus on the issues in milestone 0.4 or "critical" issues as they come up.
I don't think this feature can be implemented well until such time as we have a scheduler?
@ErisDS I don't think that we need a scheduler for sitemap.xml. As stated above it is roughly the same functionality as RSS. The url /sitemap.xml should return a XML file.
Anyway, there are more than enough open issues for milestone 0.4 that need attention first.
Putting this here as well as IRC - I think that a sitemap is significantly different to RSS because RSS only ever creates one page of a small number of posts at a time, whereas a sitemap has to go away and generate for the entire site. The larger the site the longer it takes, eventually with large blogs you have a potential DoS endpoint. Especially up until we have an api cache.
I'm also concerned about memory usage for generating the sitemap.
It would absolutely have to be heavily cached I think - and I would feel much better if it was generated either on a schedule or when something is updated, similar to using the X-Cache-Invalidation headers.
Following up with the discussion on IRC the limit for 50.000 links per sitemap was introduced by Google. For sitemaps containing more entries a Sitemap index file is recommended.(See: https://support.google.com/webmasters/answer/183668?hl=en).
Also have a read on this: http://www.sitemaps.org/protocol.html#index
Further discussion on this happened during Tuesday's public IRC meeting (#ghost, freenode, Tuesdays 5:30-7pm London time).
Logs are available here: http://107.20.237.151:8081/logs/%23ghost/20131105 (from 6pm ish)
Summary: it was agreed that generating a sitemap on GET request is not the best solution, but rather that the file will be generated & stored, and regenerated when a post is created/updated/deleted.
Storing a file has an additional difficulty because we currently do not have a general place, although content/images should be fine. This will tie further to the work being done to abstract the filesystem so that we can allow plugins to store files elsewhere/how.
@ErisDS Can you please assign this issue to me?
I think there's no need to have a perfect "massive blog enabled sitemap" Sitemaps improve discoverability of our blog contents in Search Engines so is a very important feature.
Things don't need to be "done" from first aproach, while full "massive sitemap" functionality is created I thing a basic aproach would help lots of users that at this time doesn't have nothing up to 100 blog entries.
+1 on this. I think it is very important to at least have it first.
+1 for this as well.
On Monday, November 18, 2013, Ali Al Dallal wrote:
+1 on this. I think it is very important to at least have it first.
— Reply to this email directly or view it on GitHubhttps://github.com/TryGhost/Ghost/issues/623#issuecomment-28758706 .
Wing Wong [email protected] http://about.me/wingtangwong https://www.facebook.com/wingedpower
Not sure if anything ever came of this?
It's on the roadmap for 0.4, which is scheduled for mid December https://github.com/TryGhost/Ghost/wiki/Roadmap
Hi @ErisDS , has this made its way into a version of Ghost? I can't see it anywhere in settings.
@ssx We rescheduled it to 0.6 - if you want to use it for Webmaster Tools you can also use the RSS feed for now.