# How to build a sitemap?

**URL:** <https://discuss.emberjs.com/t/how-to-build-a-sitemap/10655>\
**Category:** Ember CLI\
**Created:** [May 10, 2016, 9:35pm UTC](https://discuss.emberjs.com/t/how-to-build-a-sitemap/10655 "2016-05-10T21:35:27Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![Samshel](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/samshel/32/12187_2.png) [@Samshel](https://discuss.emberjs.com/u/Samshel)\
**Post date:** [May 10, 2016, 9:35pm UTC](https://discuss.emberjs.com/t/how-to-build-a-sitemap/10655/1 "2016-05-10T21:35:27Z")

</div>

Hello there, been searching around about the topic but there seems to be zero documentation about this for Ember 2.0+

The only addon out there is this [Ember-cli Sitemap](https://emberobserver.com/addons/ember-cli-sitemap) with the latest submit being a year older (not compatible with latest Ember versions), and also the approach from that addon is not the one I’m looking for.

My question is: How should an XML sitemap be generated on an Ember app?

---

<div class="post-metadata">

**Author:** ![jasonmit](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/jasonmit/32/182_2.png) [@jasonmit](https://discuss.emberjs.com/u/jasonmit)\
**Post date:** [May 11, 2016, 6:41am UTC](https://discuss.emberjs.com/t/how-to-build-a-sitemap/10655/2 "2016-05-11T06:41:00Z")

</div>

Really strange ember-cli-sitemap was published under a name that insinuates it’s a sitemap generator – it’s clearly not that.

If I were build one, I’d start here as a reference to walking the router syntax: [https://github.com/chadhietala/ember-router-mapper](https://github.com/chadhietala/ember-router-mapper)

---

<div class="post-metadata">

**Author:** ![Ahmad\_Musaffa](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/ahmad_musaffa/32/13691_2.png) [@Ahmad\_Musaffa](https://discuss.emberjs.com/u/Ahmad_Musaffa)\
**Post date:** [May 14, 2016, 12:54pm UTC](https://discuss.emberjs.com/t/how-to-build-a-sitemap/10655/3 "2016-05-14T12:54:15Z")

</div>

You cannot build a sitemap in the client side app because you don’t have direct access to the data. Rather you should build it in the API server using a worker process and upload it in a permanent storage like amazon S3. Then you ping Google or any other search engine with the link to the file stored in S3. You should also redirect /sitemap.xml asset requests to that link. You can rebuild the sitemap daily or weakly or monthly based on your needs.

To see how to build it in the API server, have a look at Rails’s [sitemap generator](https://github.com/kjvarga/sitemap_generator) implementation. The links generated by the sitemap generator must also match the routes defined in ember routes.

---

<div class="post-metadata">

**Author:** ![kieranhall](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/kieranhall/32/12302_2.png) [@kieranhall](https://discuss.emberjs.com/u/kieranhall)\
**Post date:** [May 16, 2016, 11:12am UTC](https://discuss.emberjs.com/t/how-to-build-a-sitemap/10655/4 "2016-05-16T11:12:30Z")

</div>

I’d consider taking a look at [Sitemap Generator](https://github.com/lgraubner/sitemap-generator).

When it comes to generating a sitemap.xml, you will probably want to integrate something like this plugin in your ember-cli-build.js. I will also be looking into a solution for generating a sitemap.xml but haven’t yet attempted to customise the Broccoli build, however, I feel that this is the way to go as Broccoli already takes care of similar tasks during a build (e.g. generates robots.txt).

---

<div class="post-metadata">

**Author:** ![Yaroslav\_Poliakov](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/yaroslav_poliakov/32/11592_2.png) [@Yaroslav\_Poliakov](https://discuss.emberjs.com/u/Yaroslav_Poliakov)\
**Post date:** [May 19, 2016, 8:54am UTC](https://discuss.emberjs.com/t/how-to-build-a-sitemap/10655/5 "2016-05-19T08:54:17Z")

</div>

But in summary, crawlers cannot render ember pages (cause JS, SPA, AJAX), so in addition you need to make server renderering for search engine crawlers, am I right?

---

<div class="post-metadata">

**Author:** ![Ahmad\_Musaffa](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/ahmad_musaffa/32/13691_2.png) [@Ahmad\_Musaffa](https://discuss.emberjs.com/u/Ahmad_Musaffa)\
**Post date:** [May 21, 2016, 11:22pm UTC](https://discuss.emberjs.com/t/how-to-build-a-sitemap/10655/6 "2016-05-21T23:22:38Z")

</div>

Now-a-days, search engines’ crawlers can render browser client side app pages. And of course, we have also ember fastboot for better SEO.

---

<div class="post-metadata">

**Author:** ![Yaroslav\_Poliakov](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/yaroslav_poliakov/32/11592_2.png) [@Yaroslav\_Poliakov](https://discuss.emberjs.com/u/Yaroslav_Poliakov)\
**Post date:** [May 22, 2016, 7:41am UTC](https://discuss.emberjs.com/t/how-to-build-a-sitemap/10655/7 "2016-05-22T07:41:54Z")

</div>

Wow! Didn’t know it. So if I understand right I can just build and deploy correct sitemap.xml and crawlers will automatically index my site? Or I need to some more moves for it?

And is it a way to check somehow that site indexed and rendered properly by search robots?

---

<div class="post-metadata">

**Author:** ![Ahmad\_Musaffa](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/ahmad_musaffa/32/13691_2.png) [@Ahmad\_Musaffa](https://discuss.emberjs.com/u/Ahmad_Musaffa)\
**Post date:** [May 22, 2016, 10:09am UTC](https://discuss.emberjs.com/t/how-to-build-a-sitemap/10655/8 "2016-05-22T10:09:31Z")

</div>

Yes. Not only it makes indexing easier, search engines also preferably index those sites who have sitemaps. Having a sitemap will let the search engines know that you are serious about SEO.

Here are some [SEO tips](http://webmasters.stackexchange.com/questions/2/what-are-the-best-ways-to-increase-a-sites-position-in-google).

---

<div class="post-metadata">

**Author:** ![Yaroslav\_Poliakov](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/yaroslav_poliakov/32/11592_2.png) [@Yaroslav\_Poliakov](https://discuss.emberjs.com/u/Yaroslav_Poliakov)\
**Post date:** [May 27, 2016, 1:14pm UTC](https://discuss.emberjs.com/t/how-to-build-a-sitemap/10655/9 "2016-05-27T13:14:01Z")

</div>

Thanks for an answer.

I test my ember web-site by google crawler test. And it renders just background without waiting for a data. Maybe you can give me a tip what I’m doing wrong?

How google see my site: [Screenshot - 2b28487ac1a25e11e2e87888779e3f2a - Gyazo](https://gyazo.com/2b28487ac1a25e11e2e87888779e3f2a)

How people see my site: [Screenshot - 009a5a9719f80aef70fc22bc3d777cba - Gyazo](https://gyazo.com/009a5a9719f80aef70fc22bc3d777cba)

---

<div class="post-metadata">

**Author:** ![joseperales](https://sea1.discourse-cdn.com/flex019/user_avatar/discuss.emberjs.com/joseperales/32/15317_2.png) [@joseperales](https://discuss.emberjs.com/u/joseperales)\
**Post date:** [October 8, 2016, 1:49pm UTC](https://discuss.emberjs.com/t/how-to-build-a-sitemap/10655/10 "2016-10-08T13:49:26Z")

</div>

I recommend this post for Emberjs SEO [Ember JS & SEO - Make your App crawlable with the Hashbang Location](http://mavilein.github.io/javascript/2013/09/03/javascript-mvc-ember-js-and-seo-crawl-with-hashbang-location/)
