From ccb23e65f368c77bfce1cf410f2a9c85237883b6 Mon Sep 17 00:00:00 2001 From: Shane Becker Date: Wed, 13 Nov 2024 18:23:53 -0800 Subject: [PATCH] Start to fix sitemap.xml --- app/middlewares/rack/clean_path.rb | 2 +- config/sitemap.rb | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/app/middlewares/rack/clean_path.rb b/app/middlewares/rack/clean_path.rb index a134ec7f3..d171def9f 100644 --- a/app/middlewares/rack/clean_path.rb +++ b/app/middlewares/rack/clean_path.rb @@ -77,7 +77,7 @@ def redirect location end def exit_early? - @req.path == '/' || @req.path.starts_with?('/assets') + @req.path == '/' || @req.path.starts_with?('/assets') || @req.path.include?('sitemap') end # get path before Unicode character got smooshed into it diff --git a/config/sitemap.rb b/config/sitemap.rb index 3dde26825..61693ee72 100644 --- a/config/sitemap.rb +++ b/config/sitemap.rb @@ -24,6 +24,9 @@ add_to_index "/categories/#{category.slug}/feed/" end + # TODO: audit this + # TODO: add /languages pages + # TODO: add locale /subdomains? static_paths = [ '/about/', '/arts/submission-guidelines', @@ -49,6 +52,7 @@ '/watch/' ] + # TODO: read this from app data tce_languages = %w[ czech deutsch @@ -87,6 +91,7 @@ add "/#{year}/" end + # TODO: only published ones [Book, Episode, Page, Podcast, Video, Zine, Journal, Issue, Episode, Poster, Sticker, Logo].each do |model| model.find_each do |page| add page.path, lastmod: page.updated_at