<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Eschew Obfuscation: Typo Google Sitemap fix</title>
    <link>http://blog.maxdunn.com/articles/2007/01/16/typo-google-sitemap-fix</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Max Dunn's Personal Blog</description>
    <item>
      <title>Typo Google Sitemap fix</title>
      <description>&lt;p&gt;I guess Google used to be more lenient in the format of their &lt;a href="http://www.google.com/webmasters/sitemaps"&gt;Sitemaps&lt;/a&gt;. However, when I installed Typo 4.0.3 and submitted a sitemap, Google didn&amp;#8217;t like the format.&lt;/p&gt;


	&lt;p&gt;The format of the &lt;a href="https://www.google.com/webmasters/tools/docs/en/protocol.html#sitemapXMLFormat"&gt;Google Sitemap&lt;/a&gt; is straightforward:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt; &amp;lt;?xml version=&amp;quot;1.0&amp;quot; encoding=&amp;quot;UTF-8&amp;quot;?&amp;gt;
  &amp;lt;urlset xmlns=&amp;quot;http://www.google.com/schemas/sitemap/0.84&amp;quot;&amp;gt;
   &amp;lt;url&amp;gt;
    &amp;lt;loc&amp;gt;http://www.example.com/&amp;lt;/loc&amp;gt;
    &amp;lt;lastmod&amp;gt;2005-01-01&amp;lt;/lastmod&amp;gt;
    &amp;lt;changefreq&amp;gt;monthly&amp;lt;/changefreq&amp;gt;
    &amp;lt;priority&amp;gt;0.8&amp;lt;/priority&amp;gt;
   &amp;lt;/url&amp;gt;  
  &amp;lt;/urlset&amp;gt; &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;However, Typo 4.0.3 and Typo edge (as of 15-Jan-2007) both used &amp;#8220;item&amp;#8221; instead of &amp;#8220;url&amp;#8221; and &amp;#8220;link&amp;#8221; instead of &amp;#8220;loc&amp;#8221;.&lt;/p&gt;


	&lt;p&gt;Luckily the fix is easy. Edit all 4 &lt;code&gt;_googlesitemap_item_*.rxml&lt;/code&gt; files in /app/views/xml and change &amp;#8220;xm.item&amp;#8221; to &amp;#8220;xm.url&amp;#8221; and &amp;#8220;xm.link&amp;#8221; to &amp;#8220;xm.loc&amp;#8221;.  For instance, &lt;code&gt;_googlesitemap_item_article.rxml&lt;/code&gt; will look like:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_ruby "&gt;&lt;span class="ident"&gt;xm&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;url&lt;/span&gt; &lt;span class="keyword"&gt;do&lt;/span&gt;
  &lt;span class="ident"&gt;xm&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;loc&lt;/span&gt; &lt;span class="ident"&gt;post_link&lt;/span&gt;&lt;span class="punct"&gt;(&lt;/span&gt;&lt;span class="ident"&gt;item&lt;/span&gt;&lt;span class="punct"&gt;)&lt;/span&gt;
  &lt;span class="ident"&gt;xm&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;lastmod&lt;/span&gt; &lt;span class="ident"&gt;item&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;updated_at&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;xmlschema&lt;/span&gt;
  &lt;span class="ident"&gt;xm&lt;/span&gt;&lt;span class="punct"&gt;.&lt;/span&gt;&lt;span class="ident"&gt;priority&lt;/span&gt; &lt;span class="number"&gt;0.8&lt;/span&gt;
&lt;span class="keyword"&gt;end&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Now make similar changes to the other 3 files. When done, go into Typo Admin, Settings, Cache and select &amp;#8220;Rebuild cached &lt;span class="caps"&gt;HTML&lt;/span&gt;&amp;#8221;. Now you can submit a sitemap like http://blog.maxdunn.com/sitemap.xml to Google Sitemaps and it will work!&lt;/p&gt;</description>
      <pubDate>Tue, 16 Jan 2007 08:59:00 -0800</pubDate>
      <guid isPermaLink="false">urn:uuid:dbdcd905-8c89-4dce-b7ef-c10c0f9c9f96</guid>
      <author>Max Dunn</author>
      <link>http://blog.maxdunn.com/articles/2007/01/16/typo-google-sitemap-fix</link>
      <category>Ruby on Rails</category>
    </item>
    <item>
      <title>"Typo Google Sitemap fix" by mmo</title>
      <description>&lt;p&gt;I think thats a pretty smart way of submitting a sitemap but it seems Like G no longer needs you to submit this as their web spiders have gotten so advanced they seem to know how to best crawl without it.&lt;/p&gt;</description>
      <pubDate>Mon, 21 Apr 2008 15:05:57 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:33b6eb35-0564-4027-a67f-a4269d4d7ef8</guid>
      <link>http://blog.maxdunn.com/articles/2007/01/16/typo-google-sitemap-fix#comment-566</link>
    </item>
  </channel>
</rss>
