diff --git a/Gemfile b/Gemfile index 8292775..ca5207e 100644 --- a/Gemfile +++ b/Gemfile @@ -17,6 +17,7 @@ gem 'unicorn' group :development do gem 'shotgun' + gem 'sitemap_generator' end group :development, :test do diff --git a/Gemfile.lock b/Gemfile.lock index 31cb54d..44f7c50 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,6 +4,7 @@ GEM addressable (2.5.2) public_suffix (>= 2.0.2, < 4.0) ast (2.4.0) + builder (3.2.3) coderay (1.1.2) crack (0.4.3) safe_yaml (~> 1.0.0) @@ -74,6 +75,8 @@ GEM rack (~> 2.0) rack-protection (= 2.0.4) tilt (~> 2.0) + sitemap_generator (6.0.1) + builder (~> 3.0) thread_safe (0.3.6) tilt (2.0.8) tzinfo (1.2.5) @@ -107,6 +110,7 @@ DEPENDENCIES sequel_pg shotgun sinatra + sitemap_generator unicorn vcr webmock diff --git a/config/sitemap.rb b/config/sitemap.rb new file mode 100644 index 0000000..a97a9a2 --- /dev/null +++ b/config/sitemap.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +SitemapGenerator::Sitemap.default_host = 'https://frankfurter.app' +SitemapGenerator::Sitemap.public_path = 'lib/web/public' +SitemapGenerator::Sitemap.create diff --git a/lib/tasks/sitemap.rake b/lib/tasks/sitemap.rake new file mode 100644 index 0000000..863cca0 --- /dev/null +++ b/lib/tasks/sitemap.rake @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +begin + require 'sitemap_generator/tasks' +rescue LoadError + return +end diff --git a/lib/web/public/robots.txt b/lib/web/public/robots.txt new file mode 100644 index 0000000..704e94c --- /dev/null +++ b/lib/web/public/robots.txt @@ -0,0 +1,4 @@ +User-agent: * +Disallow: + +Sitemap: https://frankfurter.app/sitemap.xml.gz diff --git a/lib/web/public/sitemap.xml.gz b/lib/web/public/sitemap.xml.gz new file mode 100644 index 0000000..6bf66fb Binary files /dev/null and b/lib/web/public/sitemap.xml.gz differ