Hi all,
are there any tools in CQ to create and deploy the sitemap.xml and the robots.txt?
Thanks in advance,
Michael
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
North America
Europe, Middle East and Africa
Asia Pacific