From 63b898571dd9b425dd145ef6ed2e2607eb260f67 Mon Sep 17 00:00:00 2001 From: Hakan Ensari Date: Tue, 9 Oct 2018 15:55:20 +0100 Subject: [PATCH] Add sitemap --- Gemfile | 1 + Gemfile.lock | 4 ++++ config/sitemap.rb | 5 +++++ lib/tasks/sitemap.rake | 7 +++++++ lib/web/public/robots.txt | 4 ++++ lib/web/public/sitemap.xml.gz | Bin 0 -> 331 bytes 6 files changed, 21 insertions(+) create mode 100644 config/sitemap.rb create mode 100644 lib/tasks/sitemap.rake create mode 100644 lib/web/public/robots.txt create mode 100644 lib/web/public/sitemap.xml.gz 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 0000000000000000000000000000000000000000..6bf66fb95b3eae15f98d07fb0cd6835e1e3ba8a4 GIT binary patch literal 331 zcmV-R0kr-fiwFSlzr0%j1C^4!Zo?oHMqkBZt;|o_N--kN)+wEuN?j=?HVOt8NbJ0Q z33e*C>fmf}?>U#x@@3nh)!A7(udLYs0x`&>5w=pM-hlW0OTGr%lAWCPGGvi8o(^7Z zKodeo5$gLM_K(oI8m%xU=;L+wCK}oDTp1s@5fWsPr#=;TR`8G>n(1DJ*y?;5GIAbG zMTB9I-ND|@aPSov