Skip to content

Instantly share code, notes, and snippets.

@SteveBenner
Forked from ls-lukebowerman/sitemap.xml.erb
Last active April 24, 2016 12:01
Show Gist options
  • Select an option

  • Save SteveBenner/8897566 to your computer and use it in GitHub Desktop.

Select an option

Save SteveBenner/8897566 to your computer and use it in GitHub Desktop.

Revisions

  1. SteveBenner revised this gist Oct 17, 2014. 1 changed file with 7 additions and 7 deletions.
    14 changes: 7 additions & 7 deletions sitemap.xml.slim
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    - pages = sitemap.resources.find_all{|p| p.source_file.match(/\.html/) }
    doctype xml
    urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
    - pages.each do |p|
    url
    loc "http://www.YOUR_WEBSITE_URL/#{p.destination_path.gsub('/index.html','')}"
    lastmod = Date.today.to_time.iso8601
    changefreq = p.data.changefreq || 'weekly'
    priority = p.data.priority || '0.5'
    urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
    - pages.each do |p|
    url
    loc "http://www.YOUR_WEBSITE_URL/#{p.destination_path.gsub('/index.html','')}"
    lastmod = Date.today.to_time.iso8601
    changefreq = p.data.changefreq || 'weekly'
    priority = p.data.priority || '0.5'
  2. SteveBenner revised this gist Apr 27, 2014. 1 changed file with 8 additions and 8 deletions.
    16 changes: 8 additions & 8 deletions sitemap.xml.slim
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,9 @@
    - pages = sitemap.resources.find_all{|p| p.source_file.match(/\.html/) }
    doctype xml
    urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
    - pages.each do |p|
    url
    loc "http://www.YOUR_WEBSITE_URL/#{p.destination_path.gsub('/index.html','')}"
    lastmod = Date.today.to_time.iso8601
    changefreq = p.data.changefreq || 'weekly'
    priority = p.data.priority || '0.5'
    doctype xml
    urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
    - pages.each do |p|
    url
    loc "http://www.YOUR_WEBSITE_URL/#{p.destination_path.gsub('/index.html','')}"
    lastmod = Date.today.to_time.iso8601
    changefreq = p.data.changefreq || 'weekly'
    priority = p.data.priority || '0.5'
  3. SteveBenner revised this gist Apr 27, 2014. 2 changed files with 9 additions and 12 deletions.
    12 changes: 0 additions & 12 deletions sitemap.xml.erb
    Original file line number Diff line number Diff line change
    @@ -1,12 +0,0 @@
    <% pages = sitemap.resources.find_all{|p| p.source_file.match(/\.html/) } %>
    <?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <% pages.each do |p| %>
    <url>
    <loc>http://www.YOUR_WEBSITE_URL/<%= p.destination_path.gsub('/index.html','') %></loc>
    <lastmod><%= Date.today.to_time.iso8601 %></lastmod>
    <changefreq><%= p.data.changefreq || 'weekly' %></changefreq>
    <priority><%= p.data.priority || '0.5' %></priority>
    </url>
    <% end %>
    </urlset>
    9 changes: 9 additions & 0 deletions sitemap.xml.slim
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    - pages = sitemap.resources.find_all{|p| p.source_file.match(/\.html/) }
    doctype xml
    urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
    - pages.each do |p|
    url
    loc "http://www.YOUR_WEBSITE_URL/#{p.destination_path.gsub('/index.html','')}"
    lastmod = Date.today.to_time.iso8601
    changefreq = p.data.changefreq || 'weekly'
    priority = p.data.priority || '0.5'
  4. SteveBenner revised this gist Feb 9, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions sitemap.xml.erb
    Original file line number Diff line number Diff line change
    @@ -4,8 +4,8 @@
    <% pages.each do |p| %>
    <url>
    <loc>http://www.YOUR_WEBSITE_URL/<%= p.destination_path.gsub('/index.html','') %></loc>
    <lastmod><%= Date.today.to_time.iso8601 %></lastmod>
    <changefreq><%= p.data.changefreq || 'weekly' %></changefreq>
    <lastmod><%= Date.today.to_time.iso8601 %></lastmod>
    <changefreq><%= p.data.changefreq || 'weekly' %></changefreq>
    <priority><%= p.data.priority || '0.5' %></priority>
    </url>
    <% end %>
  5. SteveBenner revised this gist Feb 9, 2014. 1 changed file with 4 additions and 2 deletions.
    6 changes: 4 additions & 2 deletions sitemap.xml.erb
    Original file line number Diff line number Diff line change
    @@ -3,8 +3,10 @@
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <% pages.each do |p| %>
    <url>
    <loc>http://youdomain.com/<%=p.destination_path.gsub('/index.html','')%></loc>
    <priority>0.7</priority>
    <loc>http://www.YOUR_WEBSITE_URL/<%= p.destination_path.gsub('/index.html','') %></loc>
    <lastmod><%= Date.today.to_time.iso8601 %></lastmod>
    <changefreq><%= p.data.changefreq || 'weekly' %></changefreq>
    <priority><%= p.data.priority || '0.5' %></priority>
    </url>
    <% end %>
    </urlset>
  6. Luke Bowerman created this gist Aug 7, 2012.
    10 changes: 10 additions & 0 deletions sitemap.xml.erb
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    <% pages = sitemap.resources.find_all{|p| p.source_file.match(/\.html/) } %>
    <?xml version="1.0" encoding="UTF-8"?>
    <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <% pages.each do |p| %>
    <url>
    <loc>http://youdomain.com/<%=p.destination_path.gsub('/index.html','')%></loc>
    <priority>0.7</priority>
    </url>
    <% end %>
    </urlset>