Google Sitemaps in Mephisto
Well we call them Google Sitemaps, but MSN and Yahoo are also on board and have formed sitemaps.org. So I guess we just call them XML sitemaps?
The 3 search engines currently don’t support the full sitemaps protocol, which is shame, hopefully by later this year they will.
First off : Mephisto, the Ruby on Rails blogging software that powers this site.
Creating a sitemap is no trouble at all with the Mephisto sitemap plugin. Although to get it working on this blog, I had to change the following in vendor/plugins/mephisto_google_sitemap/lib/mephisto_google_site_map.rb from:
1 2 3 4 5 |
def lastmod(article) time_zone = TimeZone.new(article.site.timezone.current_period.utc_offset) latest_comment = article.comments_count.zero? ? nil : article.comments.calculate(:max, :updated_at) (latest_comment.nil? ? article.updated_at : latest_comment).strftime("%Y-%m-%dT%H:%M:%S#{time_zone.formatted_offset}") end |
to:
1 2 3 4 |
def lastmod(article) latest_comment = article.comments_count.zero? ? nil : article.comments.calculate(:max, :updated_at) (latest_comment.nil? ? article.updated_at : latest_comment).strftime("%Y-%m-%dT%H:%M:%S+00:00") end |
Change +00:00 to what ever your timezone offset from UTC is. Hopefully this will be fixed in a later version of the sitemap plugin.
Like this article? Subscribe to the SEO on Rails feed.
