A sitemap is a XML file that lists the URLs for a site. It allows webmasters to include additional information about each URL: when it was last updated, how often it changes, and how important it is in relation to other URLs in the site, for example. This allows search engines to crawl the site more intelligently.
Google will look for this sitemap.xml in your domain's top level directory - e.g.: http://help.k15t.com/sitemap.xml
Viewport does not support sitemaps out of the box but there are several workarounds:
Workaround 1: Dynamically generate a sitemap using a custom velocity template
You can automatically generate a sitemap with the HTML/Velocity template below. Save it as
sitemap.xml.vm in your viewport theme
#set($PAGE_FILTER = [ "sitemap.xml" ])#* *##macro(processChildren $page)#* *##if (!$PAGE_FILTER.contains($page.title))#* *#<url> <loc>$page.absoluteLink</loc> </url> #end #foreach($child in $page.children)#* *##processChildren($child) #end #end#* *#<?xml version="1.0" encoding="UTF-8"?> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"> #processChildren($home) </urlset>
To make the sitemap available, you need to create a placeholder page in the space so Scroll Viewport can handle requests to
.../sitemap.xml and then tell Scroll Viewport to use the
sitemap.xml.vm template from your theme to produce the sitemap on the fly.
- Create a page called sitemap.xml as a direct child of the home page.
- Add a page properties macro as follows on that page:
The value of the property must mach the name of the template in your viewport theme.
Workaround 2: Embed Static Sitemap Content in your Viewport Theme
- In the space for the viewport for "/" create a new page called
sitemap.xmlas child of the home page
- In your theme's
page.vmtemplate make sure that when this page is rendered only the content of the file without any HTML tags rendered.
- You can either add the sitemap.xml contents to your template or take it from the Confluence page.
- If your template has a page tree you'll want to adapt it so it filters out pages called
Workaround 3: Static sitemap.xml File served by a Reverse Proxy
- Set up a reverse proxy in front of Confluence (Apache, Nginx, ...)
- Configure it to serve requests to sitemap.xml itself instead of forwarding it to Confluence. The actual configuration depends on your reverse proxy software and configuration.