Skip to content

Commit

Permalink
Merge pull request #3382 from Vizzuality/fix/sitemaps
Browse files Browse the repository at this point in the history
Fix/sitemaps
  • Loading branch information
pjosh committed Apr 26, 2018
2 parents 434bc30 + bdacc98 commit 9e6a3bb
Show file tree
Hide file tree
Showing 57 changed files with 133 additions and 98 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ gem 'fog'
gem 'rmagick', :require => false
gem 'mini_magick'
gem 'unf'
gem 'sitemap_generator'

# requirejs
gem 'erubis'
Expand Down
3 changes: 3 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,8 @@ GEM
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
sitemap_generator (6.0.1)
builder (~> 3.0)
spring (2.0.2)
activesupport (>= 4.2)
sprockets (3.7.1)
Expand Down Expand Up @@ -495,6 +497,7 @@ DEPENDENCIES
shoulda-matchers
show_me_the_cookies
simplecov
sitemap_generator
spring
sprockets-rails (= 2.3.3)
typhoeus
Expand Down
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
28 changes: 14 additions & 14 deletions app/views/shared/_favicons.html.erb
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<!-- IOS, Android, favicons icons -->
<link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="/manifest.json">
<link rel="apple-touch-icon" sizes="57x57" href="/assets/favicons/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="/assets/favicons/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="/assets/favicons/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="/assets/favicons/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="/assets/favicons/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="/assets/favicons/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="/assets/favicons/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="/assets/favicons/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="/assets/favicons/apple-touch-icon-180x180.png">
<link rel="icon" type="image/png" href="/assets/favicons/favicon-32x32.png" sizes="32x32">
<link rel="icon" type="image/png" href="/assets/favicons/android-chrome-192x192.png" sizes="192x192">
<link rel="icon" type="image/png" href="/assets/favicons/favicon-96x96.png" sizes="96x96">
<link rel="icon" type="image/png" href="/assets/favicons/favicon-16x16.png" sizes="16x16">
<link rel="manifest" href="/assets/favicons/manifest.json">
<meta name="msapplication-TileColor" content="#ff0000">
<meta name="msapplication-TileImage" content="/mstile-144x144.png">
<meta name="theme-color" content="#ffffff">
Expand Down
84 changes: 84 additions & 0 deletions app/views/sitemap/show.xml.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="UTF-8"?>
<urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd">
<!-- created with Free Online Sitemap Generator www.xml-sitemaps.com -->

<url>
<loc>http://www.globalforestwatch.org</loc>
<changefreq>weekly</changefreq>
<priority>1.00</priority>
</url>
<url>
<loc>http://www.globalforestwatch.org/map</loc>
<changefreq>monthly</changefreq>
<priority>0.90</priority>
</url>
<url>
<loc>http://www.globalforestwatch.org/countries</loc>
<changefreq>monthly</changefreq>
<priority>0.90</priority>
</url>
<url>
<loc>http://www.globalforestwatch.org/stories</loc>
<changefreq>weekly</changefreq>
<priority>0.90</priority>
</url>
<url>
<loc>http://blog.globalforestwatch.org</loc>
<changefreq>weekly</changefreq>
<priority>0.90</priority>
</url>
<url>
<loc>http://commodities.globalforestwatch.org/</loc>
<changefreq>weekly</changefreq>
<priority>0.90</priority>
</url>
<url>
<loc>http://fires.globalforestwatch.org/</loc>
<changefreq>dayly</changefreq>
<priority>0.90</priority>
</url>
<url>
<loc>http://data.globalforestwatch.org/</loc>
<changefreq>monthly</changefreq>
<priority>0.80</priority>
</url>
<url>
<loc>http://www.globalforestwatch.org/explore</loc>
<changefreq>yearly</changefreq>
<priority>0.80</priority>
</url>
<url>
<loc>http://www.globalforestwatch.org/stayinformed</loc>
<changefreq>yearly</changefreq>
<priority>0.80</priority>
</url>
<url>
<loc>http://www.globalforestwatch.org/getinvolved</loc>
<changefreq>yearly</changefreq>
<priority>0.80</priority>
</url>
<url>
<loc>http://www.globalforestwatch.org/howto</loc>
<changefreq>yearly</changefreq>
<priority>0.80</priority>
</url>
<url>
<loc>http://www.globalforestwatch.org/about</loc>
<changefreq>yearly</changefreq>
<priority>0.80</priority>
</url>
<url>
<loc>http://www.globalforestwatch.org/countries/overview</loc>
<changefreq>yearly</changefreq>
<priority>0.80</priority>
</url>
<url>
<loc>http://www.globalforestwatch.org/terms</loc>
<changefreq>monthly</changefreq>
<priority>0.20</priority>
</url>
</urlset>
1 change: 1 addition & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
require "action_controller/railtie"
require "action_mailer/railtie"
require "sprockets/railtie"
require 'sitemap_generator/tasks'
# require "active_model"
# require "rails/test_unit/railtie"

Expand Down
29 changes: 29 additions & 0 deletions config/sitemap.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Set the host name for URL creation
SitemapGenerator::Sitemap.default_host = "https://www.globalforestwatch.org"
SitemapGenerator::Sitemap.compress = false

SitemapGenerator::Sitemap.create do
add '/map', :changefreq => 'weekly', :priority => 0.8
add '/countries', :changefreq => 'weekly', :priority => 0.8
add '/country', :changefreq => 'weekly', :priority => 0.8

Country.find_all.each do |country|
add "/country/#{country['iso']}", :changefreq => 'weekly', :priority => 0.6
end

add '/about', :changefreq => 'weekly', :priority => 0.8
add '/small-grants-fund', :changefreq => 'weekly', :priority => 0.8
add '/search', :changefreq => 'weekly', :priority => 0.8
add '/stories', :changefreq => 'weekly', :priority => 0.8

add '/contribute-data', :changefreq => 'weekly', :priority => 0.4
add '/sitemap', :changefreq => 'weekly', :priority => 0.4
add '/terms', :changefreq => 'weekly', :priority => 0.4

# external apps
add '/howto', :changefreq => 'weekly', :priority => 0.4
add 'https://developers.globalforestwatch.org', :changefreq => 'weekly', :priority => 0.4
add 'http://data.globalforestwatch.org', :changefreq => 'weekly', :priority => 0.4
add 'http://blog.globalforestwatch.org', :changefreq => 'weekly', :priority => 0.4

end
Binary file removed public/chosen_v0.13.0.zip
Binary file not shown.
85 changes: 1 addition & 84 deletions public/sitemap.xml

Large diffs are not rendered by default.

0 comments on commit 9e6a3bb

Please sign in to comment.