Ghost icon indicating copy to clipboard operation
Ghost copied to clipboard

[Feature] Generate sitemap.xml

Open sebgie opened this issue 13 years ago • 36 comments

[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.

sebgie avatar Sep 04 '13 12:09 sebgie

+1, but this is a little way off

JohnONolan avatar Sep 04 '13 12:09 JohnONolan

I know, just wanted to note it down. You can assign it to milestone 0.far_far_away.

sebgie avatar Sep 04 '13 12:09 sebgie

@JohnONolan: Mind if I work on this one?

halfdan avatar Oct 17 '13 06:10 halfdan

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.

matteocrippa avatar Oct 19 '13 15:10 matteocrippa

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 avatar Oct 19 '13 17:10 halfdan

@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.

gotdibbs avatar Oct 19 '13 17:10 gotdibbs

I don't think this feature can be implemented well until such time as we have a scheduler?

ErisDS avatar Oct 20 '13 10:10 ErisDS

@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.

sebgie avatar Oct 20 '13 10:10 sebgie

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.

ErisDS avatar Nov 04 '13 20:11 ErisDS

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).

sebgie avatar Nov 05 '13 08:11 sebgie

Also have a read on this: http://www.sitemaps.org/protocol.html#index

halfdan avatar Nov 05 '13 08:11 halfdan

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 avatar Nov 07 '13 08:11 ErisDS

@ErisDS Can you please assign this issue to me?

halfdan avatar Nov 07 '13 09:11 halfdan

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.

JuanKRuiz avatar Nov 13 '13 01:11 JuanKRuiz

+1 on this. I think it is very important to at least have it first.

alicoding avatar Nov 19 '13 01:11 alicoding

+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

WingTangWong avatar Nov 19 '13 05:11 WingTangWong

Not sure if anything ever came of this?

iteles avatar Nov 22 '13 20:11 iteles

It's on the roadmap for 0.4, which is scheduled for mid December https://github.com/TryGhost/Ghost/wiki/Roadmap

ErisDS avatar Nov 22 '13 20:11 ErisDS

Hi @ErisDS , has this made its way into a version of Ghost? I can't see it anywhere in settings.

ssx avatar Mar 20 '14 12:03 ssx

@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.

halfdan avatar Mar 20 '14 12:03 halfdan