From 1a7d0f5ab965876e5a018603697e2b4fc47724be Mon Sep 17 00:00:00 2001 From: Holger Just Date: Sat, 5 Dec 2015 23:52:41 +0100 Subject: [PATCH] Generate correct URLs to pages in sitemap.xml --- source/sitemap.xml.builder | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/sitemap.xml.builder b/source/sitemap.xml.builder index 081be25..ecbf0d2 100644 --- a/source/sitemap.xml.builder +++ b/source/sitemap.xml.builder @@ -2,8 +2,8 @@ xml.instruct! xml.urlset 'xmlns' => "http://www.sitemaps.org/schemas/sitemap/0.9" do sitemap.resources.select { |page| page.destination_path =~ /\.html/ && page.data.noindex != true }.each do |page| xml.url do - xml.loc URI.join(settings.casper[:blog][:url], page.destination_path) - last_mod = if page.path.start_with?('articles/') + xml.loc URI.join(settings.casper[:blog][:url], page.url) + last_mod = if page.path =~ /^\d{4}/ File.mtime(page.source_file).to_time else Time.now