From fe6e7e2a0136df9c5ce63e78e1e481f3d69a0afb Mon Sep 17 00:00:00 2001 From: Seth Vargo Date: Tue, 21 Oct 2014 23:20:21 -0400 Subject: [PATCH] Add sitemap --- website/source/sitemap.xml.builder | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 website/source/sitemap.xml.builder diff --git a/website/source/sitemap.xml.builder b/website/source/sitemap.xml.builder new file mode 100644 index 000000000..a08b5b0e3 --- /dev/null +++ b/website/source/sitemap.xml.builder @@ -0,0 +1,19 @@ +--- +layout: false +--- + +xml.instruct! +xml.urlset 'xmlns' => "http://www.sitemaps.org/schemas/sitemap/0.9" do + sitemap + .resources + .select { |page| page.path =~ /\.html/ } + .select { |page| !page.data.noindex } + .each do |page| + xml.url do + xml.loc File.join(base_url, page.url) + xml.lastmod Date.today.to_time.iso8601 + xml.changefreq page.data.changefreq || "monthly" + xml.priority page.data.priority || "0.5" + end + end +end