-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Andy Jones
committed
Jun 15, 2022
1 parent
6d22f74
commit f30c475
Showing
5 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<% sitemap.resources.each do |page| %><%= "#{URI.join(config[:host], page.url)}\n" if page.url !~ /\.(css|js|eot|svg|woff|ttf|png|jpg|jpeg|gif|keep)$/ %><% end %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
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(config[:host], page.destination_path) | ||
last_mod = if page.path.start_with?('articles/') | ||
File.mtime(page.source_file).to_time | ||
else | ||
Time.now | ||
end | ||
xml.lastmod last_mod.iso8601 | ||
xml.changefreq page.data.changefreq || "monthly" | ||
xml.priority page.data.priority || "0.5" | ||
end | ||
end | ||
end |