Wednesday, 8 October 2014

Sitemaps for AngularJS and other SPA frameworks



I need to create a sitemap for a semi-large app, with ~20K distinct urls. Not only that, I also need a:



I did my homework and found the three - four questions here on stackoverflow, but none of them provides a general solution for the task. There is of course the article on Year of Moo http://ift.tt/V2cSS8 which provides an idea of how it should look like, but not how to generate one. There is also this answer Angularjs SPA and generating sitemap and both of them suggest to generate a sitemap server-side, from the data. That is of course doable.


But isn't there another way?


I tried most (if not all) of the generators listed here http://ift.tt/1msrY4X, none of them work, even though we use prerender.io.


One solution I though might be possible, was to use Google's googlesitemapgenerator http://ift.tt/1tC7apJ which is supposed to be a next-gen tool. I believe I would need to:



  1. connect that to my NodeJS webserver that serves the client app, and is hosted on Heroku

  2. change the code to ensure the generators agent is captured by prerender.io

  3. still configure everything by hand, which might take as much work as the mentioned server-side code


But I am not even sure if that would work and it seems like it can take a significant amount of time.


Another idea - use the RSS feed instead of the map. Still needs to be generated by server-side code, so pretty much same thing.


tl;dr


It seems that it's a really easy task for websites, and maybe there is now a good, automated, general way to create sitemaps for SPAs too?


No comments:

Post a Comment