Create a google sitemap.xml file ?

jperreault's Avatar

jperreault

Jun 20, 2011 @ 06:25 AM

Hi,

we just launched our website and am anxious to see google re-index the site. One thing we don't have is a sitemap.xml file.

I'm pretty sure I can use an index block to create a sitemap.xml file for google to index. has anyone already written some velocity to do this?

Thanks,

Jeff

  1. 1 Posted by Camilo Payan on Jun 22, 2011 @ 08:10 PM

    Camilo Payan's Avatar

    I'm working on the same thing, with a XSLT solution, which is attached.

    Dependencies:

    1. Needs to format an index block that has is-published information. Reason being you don't want unpublished pages in your sitemap.xml
    2. format-date format. Requires the hannonhill date converter, to populate the last-modified field validly.
    3. variables file. looking at the line
      <xsl:include href="/_internal/formats/xslt/variables"/>
      

      as you can see, you need a variables format. I use it for more than this, but the important thing is to declare a variable there named "siteUrl". Reason being that the sitemap spec on sitemaps.org needs a fully qualified url: http://yoursite.com/foo/bar but there's isn't a simple or easy way to do this. To make this script more portable, we keep hardcoded stuff in a variables format, and include it as needed.

    'Twas actually a suggestion from Ross in http://help.hannonhill.com/discussions/how-do-i/331-translate-site-..., and can stand to get some improvement.

  2. 2 Posted by bwmyers on Jun 28, 2011 @ 06:39 PM

    bwmyers's Avatar

    Can you share the two include files that you are using (variables and format date)?

  3. 3 Posted by cpayan on Jun 28, 2011 @ 08:55 PM

    cpayan's Avatar

    The variables.xslt file is simple. It's just an xslt file containing a bunch of variables like so:
    http://www.mysite.com//xsl:variable /xsl:stylesheet

    I've attached the format-date.

  4. 4 Posted by bwmyers on Jul 01, 2011 @ 05:45 PM

    bwmyers's Avatar

    Thanks a lot Camilo. -Bradley

  5. 5 Posted by bwmyers on Jul 01, 2011 @ 08:05 PM

    bwmyers's Avatar

    Quick question on below:

    <xsl:value-of select="concat('[system-view:external]',$siteUrl,'[/system-view:external][system-asset]',link,'[/system-asset]')"/>

    What exactly is link? When I publish the xml file out I get:

    http://www.pizzafresh.com/

    For everything. Need the rest of the path on the end. I am assuming link takes care of that but I didn't see it defined anywhere.

    Thanks For your help. -Bradley

  6. 6 Posted by bwmyers on Jul 01, 2011 @ 08:25 PM

    bwmyers's Avatar

    Never mind the last comment. My block was set up wrong. Thanks, Again

  7. Charlie Holder closed this discussion on Mar 27, 2012 @ 04:36 AM.

Discussions are closed to public comments.
If you need help with Cascade CMS please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac