diff --git a/Gemfile b/Gemfile index 1d4b59fd..cea23612 100644 --- a/Gemfile +++ b/Gemfile @@ -32,7 +32,7 @@ gem "mysql2", "~>0.5.0" gem "nokogiri", "~>1.10" gem "redis", "~>5.0" gem "rinku", "~>2.0" -gem "sitemap_generator", "~>2.1" +gem "sitemap_generator" gem "state_machines-activerecord" # Gems used for assets diff --git a/Gemfile.lock b/Gemfile.lock index f882185e..b028983b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -42,35 +42,35 @@ GIT GEM remote: https://rubygems.org/ specs: - actioncable (7.1.3.2) - actionpack (= 7.1.3.2) - activesupport (= 7.1.3.2) + actioncable (7.1.3.4) + actionpack (= 7.1.3.4) + activesupport (= 7.1.3.4) nio4r (~> 2.0) websocket-driver (>= 0.6.1) zeitwerk (~> 2.6) - actionmailbox (7.1.3.2) - actionpack (= 7.1.3.2) - activejob (= 7.1.3.2) - activerecord (= 7.1.3.2) - activestorage (= 7.1.3.2) - activesupport (= 7.1.3.2) + actionmailbox (7.1.3.4) + actionpack (= 7.1.3.4) + activejob (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) mail (>= 2.7.1) net-imap net-pop net-smtp - actionmailer (7.1.3.2) - actionpack (= 7.1.3.2) - actionview (= 7.1.3.2) - activejob (= 7.1.3.2) - activesupport (= 7.1.3.2) + actionmailer (7.1.3.4) + actionpack (= 7.1.3.4) + actionview (= 7.1.3.4) + activejob (= 7.1.3.4) + activesupport (= 7.1.3.4) mail (~> 2.5, >= 2.5.4) net-imap net-pop net-smtp rails-dom-testing (~> 2.2) - actionpack (7.1.3.2) - actionview (= 7.1.3.2) - activesupport (= 7.1.3.2) + actionpack (7.1.3.4) + actionview (= 7.1.3.4) + activesupport (= 7.1.3.4) nokogiri (>= 1.8.5) racc rack (>= 2.2.4) @@ -80,35 +80,35 @@ GEM rails-html-sanitizer (~> 1.6) actionpack-page_caching (1.2.4) actionpack (>= 4.0.0) - actiontext (7.1.3.2) - actionpack (= 7.1.3.2) - activerecord (= 7.1.3.2) - activestorage (= 7.1.3.2) - activesupport (= 7.1.3.2) + actiontext (7.1.3.4) + actionpack (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) globalid (>= 0.6.0) nokogiri (>= 1.8.5) - actionview (7.1.3.2) - activesupport (= 7.1.3.2) + actionview (7.1.3.4) + activesupport (= 7.1.3.4) builder (~> 3.1) erubi (~> 1.11) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - activejob (7.1.3.2) - activesupport (= 7.1.3.2) + activejob (7.1.3.4) + activesupport (= 7.1.3.4) globalid (>= 0.3.6) - activemodel (7.1.3.2) - activesupport (= 7.1.3.2) - activerecord (7.1.3.2) - activemodel (= 7.1.3.2) - activesupport (= 7.1.3.2) + activemodel (7.1.3.4) + activesupport (= 7.1.3.4) + activerecord (7.1.3.4) + activemodel (= 7.1.3.4) + activesupport (= 7.1.3.4) timeout (>= 0.4.0) - activestorage (7.1.3.2) - actionpack (= 7.1.3.2) - activejob (= 7.1.3.2) - activerecord (= 7.1.3.2) - activesupport (= 7.1.3.2) + activestorage (7.1.3.4) + actionpack (= 7.1.3.4) + activejob (= 7.1.3.4) + activerecord (= 7.1.3.4) + activesupport (= 7.1.3.4) marcel (~> 1.0) - activesupport (7.1.3.2) + activesupport (7.1.3.4) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -118,8 +118,9 @@ GEM minitest (>= 5.1) mutex_m tzinfo (~> 2.0) - acts_as_list (1.1.0) - activerecord (>= 4.2) + acts_as_list (1.2.1) + activerecord (>= 6.1) + activesupport (>= 6.1) addressable (2.8.6) public_suffix (>= 2.0.2, < 6.0) annotate (3.2.0) @@ -132,7 +133,7 @@ GEM erubi (>= 1.0.0) rack (>= 0.9.0) rouge (>= 1.0.0) - bigdecimal (3.1.7) + bigdecimal (3.1.8) bindex (0.8.1) binding_of_caller (1.0.1) debug_inspector (>= 1.2.0) @@ -140,7 +141,7 @@ GEM activerecord (>= 5.1) bootsnap (1.18.3) msgpack (~> 1.2) - builder (3.2.4) + builder (3.3.0) byebug (11.1.3) canable (0.3.0) carrierwave (3.0.7) @@ -151,19 +152,19 @@ GEM marcel (~> 1.0.0) ssrf_filter (~> 1.0) childprocess (5.0.0) - concurrent-ruby (1.2.3) + concurrent-ruby (1.3.2) connection_pool (2.4.1) crass (1.0.6) date (3.3.4) debug_inspector (1.2.0) - devise (4.9.3) + devise (4.9.4) bcrypt (~> 3.0) orm_adapter (~> 0.1) railties (>= 4.1.0) responders warden (~> 1.2.3) docile (1.4.0) - doorkeeper (5.6.9) + doorkeeper (5.7.0) railties (>= 5) drb (2.2.1) erubi (1.12.0) @@ -187,7 +188,7 @@ GEM html_truncator (0.4.2) nokogiri (~> 1.5) htmlentities (4.3.4) - i18n (1.14.4) + i18n (1.14.5) concurrent-ruby (~> 1.0) image_processing (1.12.2) mini_magick (>= 4.9.5, < 5) @@ -198,8 +199,8 @@ GEM railties (>= 6.0) responders (>= 2) io-console (0.7.2) - irb (1.12.0) - rdoc + irb (1.13.1) + rdoc (>= 4.0.0) reline (>= 0.4.2) jquery-rails (4.6.0) rails-dom-testing (>= 1, < 3) @@ -218,7 +219,7 @@ GEM kaminari-core (= 1.2.2) kaminari-core (1.2.2) kgio (2.11.4) - launchy (3.0.0) + launchy (3.0.1) addressable (~> 2.8) childprocess (~> 5.0) letter_opener (1.10.0) @@ -234,12 +235,13 @@ GEM marcel (1.0.4) mini_magick (4.12.0) mini_mime (1.1.5) - minitest (5.22.3) + mini_portile2 (2.8.7) + minitest (5.23.1) msgpack (1.7.2) multi_json (1.15.0) mutex_m (0.2.0) mysql2 (0.5.6) - net-imap (0.4.10) + net-imap (0.4.12) date net-protocol net-pop (0.1.2) @@ -248,8 +250,11 @@ GEM timeout net-smtp (0.5.0) net-protocol - nio4r (2.7.1) - nokogiri (1.16.3-x86_64-linux) + nio4r (2.7.3) + nokogiri (1.16.5) + mini_portile2 (~> 2.8.2) + racc (~> 1.4) + nokogiri (1.16.5-x86_64-linux) racc (~> 1.4) nokogumbo (2.0.5) nokogiri (~> 1.8, >= 1.8.4) @@ -258,13 +263,13 @@ GEM patron (0.13.3) psych (5.1.2) stringio - public_suffix (5.0.4) + public_suffix (5.0.5) puma (6.4.2) nio4r (~> 2.0) pygments.rb (1.2.1) multi_json (>= 1.0.0) - racc (1.7.3) - rack (3.0.10) + racc (1.8.0) + rack (3.0.11) rack-session (2.0.0) rack (>= 3.0.0) rack-test (2.1.0) @@ -272,20 +277,20 @@ GEM rackup (2.1.0) rack (>= 3) webrick (~> 1.8) - rails (7.1.3.2) - actioncable (= 7.1.3.2) - actionmailbox (= 7.1.3.2) - actionmailer (= 7.1.3.2) - actionpack (= 7.1.3.2) - actiontext (= 7.1.3.2) - actionview (= 7.1.3.2) - activejob (= 7.1.3.2) - activemodel (= 7.1.3.2) - activerecord (= 7.1.3.2) - activestorage (= 7.1.3.2) - activesupport (= 7.1.3.2) + rails (7.1.3.4) + actioncable (= 7.1.3.4) + actionmailbox (= 7.1.3.4) + actionmailer (= 7.1.3.4) + actionpack (= 7.1.3.4) + actiontext (= 7.1.3.4) + actionview (= 7.1.3.4) + activejob (= 7.1.3.4) + activemodel (= 7.1.3.4) + activerecord (= 7.1.3.4) + activestorage (= 7.1.3.4) + activesupport (= 7.1.3.4) bundler (>= 1.15.0) - railties (= 7.1.3.2) + railties (= 7.1.3.4) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -293,27 +298,27 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - railties (7.1.3.2) - actionpack (= 7.1.3.2) - activesupport (= 7.1.3.2) + railties (7.1.3.4) + actionpack (= 7.1.3.4) + activesupport (= 7.1.3.4) irb rackup (>= 1.0.0) rake (>= 12.2) thor (~> 1.0, >= 1.2.2) zeitwerk (~> 2.6) raindrops (0.20.1) - rake (13.1.0) + rake (13.2.1) rb-fsevent (0.11.2) - rb-inotify (0.10.1) + rb-inotify (0.11.1) ffi (~> 1.0) - rdoc (6.6.3.1) + rdoc (6.7.0) psych (>= 4.0.0) redcarpet (3.6.0) - redis (5.1.0) - redis-client (>= 0.17.0) - redis-client (0.21.1) + redis (5.2.0) + redis-client (>= 0.22.0) + redis-client (0.22.2) connection_pool - reline (0.5.0) + reline (0.5.8) io-console (~> 0.5) responders (3.1.1) actionpack (>= 5.2) @@ -340,14 +345,15 @@ GEM simplecov_json_formatter (~> 0.1) simplecov-html (0.12.3) simplecov_json_formatter (0.1.4) - sitemap_generator (2.2.1) - spring (4.1.3) + sitemap_generator (6.3.0) + builder (~> 3.0) + spring (4.2.1) sprockets (4.2.1) concurrent-ruby (~> 1.0) rack (>= 2.2.4, < 4) - sprockets-rails (3.4.2) - actionpack (>= 5.2) - activesupport (>= 5.2) + sprockets-rails (3.5.1) + actionpack (>= 6.1) + activesupport (>= 6.1) sprockets (>= 3.0.0) ssrf_filter (1.1.2) state_machines (0.6.0) @@ -359,7 +365,7 @@ GEM state_machines-activemodel (>= 0.9.0) stringio (3.1.0) temple (0.10.3) - terser (1.2.1) + terser (1.2.2) execjs (>= 0.3.0, < 3) thor (1.3.1) tilt (2.3.0) @@ -380,9 +386,10 @@ GEM websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - zeitwerk (2.6.13) + zeitwerk (2.6.15) PLATFORMS + ruby x86_64-linux DEPENDENCIES @@ -423,7 +430,7 @@ DEPENDENCIES rinku (~> 2.0) sassc-rails simplecov - sitemap_generator (~> 2.1) + sitemap_generator spring state_machines-activerecord terser (~> 1.2) diff --git a/config/sitemap.rb b/config/sitemap.rb index 1366b063..77249301 100644 --- a/config/sitemap.rb +++ b/config/sitemap.rb @@ -1,8 +1,7 @@ -# encoding: utf-8 # Set the host name for URL creation -SitemapGenerator::Sitemap.default_host = "https://linuxfr.org/" +SitemapGenerator::Sitemap.default_host = 'https://linuxfr.org/' -SitemapGenerator::Sitemap.add_links do |sitemap| +SitemapGenerator::Sitemap.create do |sitemap| # Put links creation logic here. # # The root path '/' and sitemap index file are added automatically. @@ -44,6 +43,7 @@ Node.sitemap(Diary).find_each do |node| diary = node.content next if diary.owner.nil? + sitemap.add user_diary_path(user_id: diary.owner, id: diary), priority: 0.8, changefreq: diary.changefreq, lastmod: diary.lastmod end @@ -52,6 +52,7 @@ Node.sitemap(Bookmark).find_each do |node| bookmark = node.content next if bookmark.owner.nil? + sitemap.add user_bookmark_path(user_id: bookmark.owner, id: bookmark), priority: 0.8, changefreq: bookmark.changefreq, lastmod: bookmark.lastmod end @@ -82,5 +83,4 @@ wiki_page = node.content sitemap.add wiki_page_path(wiki_page), priority: 0.8, changefreq: wiki_page.changefreq, lastmod: wiki_page.lastmod end - end