Expand my Community achievements bar.

Radically easy to access on brand approved content for distribution and omnichannel performant delivery. AEM Assets Content Hub and Dynamic Media with OpenAPI capabilities is now GA.

What are the best ways to implement a sitemap?

Avatar

Level 4

Hi all,

Have you done a sitemap implementation for websites using AEM? What was the procedure and steps you have done? Can you please elaborate your experiences so that I can get some inputs? 
My requirement is simple - Business will give the rootpath and the pages which should not be indexed for sitemap (this I can control through page properties by overlaying). Based this I have to generate the sitemap. Do we have to create an XML and robots.txt? Or an index.html page listing all pages. 

OOB Sitemap component only prints the rootpage and its children. It doesn't generate XML or anything. Please tell me how you have implemented in your projects.

 

Thanks

4 Replies

Avatar

Level 4

I have gone through those before but it's very vague. I want to know how people here have implemented. The procedures mainly.

Avatar

Level 2

I would +1 cquser1 response. ACS provides a comprehensive coverage on sitemap.xml generation. It also takes care alias names (for multi lingual pages with local page names).

For robots.txt, I can suggest a GET servlet

Avatar

Level 9

Hi vitis90,

it is fairy easy if you want to generate a simple xml out of given hierarchy and exclude some of pages/directory. iterate all the pages recursively and Use Javax.xml API to generate XML. Make sure you have check to exclude list of pages. 

One last thing, you should be creating sitemap.xml file under language page (e.g. en, fr).

In this whole process, i don't see point of creating followings:

  • Index.html page
  • Managing page properties checkbox to exclude a page from sitemap. Because that is overhead. Just OSGI configuration should be fine.
  • Robots.txt is different than sitemap. we should be creating robots.txt separately.

I hope this helps.

Regards,

Jitendra