Skip navigation
Currently Being Moderated

sitemap.xml and robots.txt

Aug 29, 2011 7:22 AM

Hi all,

 

are there any tools in CQ to create and deploy the sitemap.xml and the robots.txt?

 

Thanks in advance,

 

Michael

 
Replies
  • Currently Being Moderated
    Sep 10, 2011 7:15 AM   in reply to MichaelDeiss

    Hi Michael,

     

    There's unfortunately no automated tool for that yet in CQ.

     

    If you want to build something like that yourself, the best is to create a page somewhere in your site structure that isn't displayed in the navigation (you would  name this page "sitemap" or "robots" - without the extention). You also need to build a custom page component for each of these two type of special pages, where you control the output to be exactly what you need (ie. no HTML in the output) - for a first version, simply hardcode the content of each in the JSPs, later, you can then make it more sophisticated (eg. reading out a page property, or iterating over your page structure). Using CRXDE Light, you obviously need to change the sling:resourceType property of your sitemap or robots page to point to the appropriate new page components.

     

    Then to make these pages available on the root path, you can use the /etc/map settings. Such a configuration would look like follows in the case of the robots.txt (use CRXDE Light to create the node and it's properties):

    /etc/map/www-robots.txt

         jcr:primaryType = "sling:Mapping" (that's the type when you create a new node)

         sling:internalRedirect = "/content/SITE/PATH/robots.html"

         sling:match = "http/www.SITE.com/robots.txt"

     

    Btw, this is the documentation for the mapping: http://sling.apache.org/site/mappings-for-resource-resolution.html

     

    Hope that helps!

    Gabriel

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points