Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start to fix sitemap.xml #4060

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/middlewares/rack/clean_path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 5 additions & 0 deletions config/sitemap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -49,6 +52,7 @@
'/watch/'
]

# TODO: read this from app data
tce_languages = %w[
czech
deutsch
Expand Down Expand Up @@ -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
Expand Down