Skip to content

Scope sitemap to space#1285

Open
fbacall wants to merge 9 commits intomasterfrom
copilot/scope-sitemaps-to-space
Open

Scope sitemap to space#1285
fbacall wants to merge 9 commits intomasterfrom
copilot/scope-sitemaps-to-space

Conversation

@fbacall
Copy link
Copy Markdown
Member

@fbacall fbacall commented Apr 17, 2026

Summary of changes

  • Generate individual sitemaps for each space (if spaces enabled)
  • Serve sitemap through app for current space

Motivation and context

Sitemap would previously show content for all spaces.

Checklist

  • I have read and followed the CONTRIBUTING guide.
  • I confirm that I have the authority necessary to make this contribution on behalf of its copyright owner and agree to license it to the TeSS codebase under the BSD license.

Copilot AI and others added 3 commits April 17, 2026 14:57
- Refactor config/sitemap.rb to generate one sitemap per space when spaces
  feature is enabled; always generates a global sitemap for the main domain
- Add SitemapsController#index that redirects to the space-specific sitemap
  (e.g. /sitemaps/<host>/sitemap.xml) or global sitemap based on current space
- Add route GET /sitemap.xml => sitemaps#index
- Update sitemap integration test: host-agnostic LocalSitemapParser, rm_rf
  teardown, and new test for space-scoped sitemap generation
- Add SitemapsController tests for redirect behaviour

Agent-Logs-Url: https://github.com/ElixirTeSS/TeSS/sessions/e519d1b0-2375-4f48-8787-a6ae3863c968

Co-authored-by: fbacall <503373+fbacall@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Scopes sitemap generation/serving to the current Space so that space hosts expose a sitemap containing only that space’s content, while retaining a global sitemap for the default domain.

Changes:

  • Update sitemap generation to always build a global sitemap and (when spaces are enabled) additionally build per-space sitemaps under public/sitemaps/<space.host>/.
  • Add an app route for /sitemap.xml and a controller entrypoint intended to serve the appropriate sitemap for the current space.
  • Extend test coverage for space-scoped sitemap generation and controller behavior.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
test/integration/sitemap_test.rb Adds coverage for per-space sitemap generation and improves local sitemap parsing.
test/controllers/sitemaps_controller_test.rb Adds controller-level expectations for /sitemap.xml behavior across spaces settings/hosts.
config/sitemap.rb Generates global + per-space sitemap files and scopes resources via the space instance.
config/routes.rb Adds /sitemap.xml route to go through the app.
app/controllers/sitemaps_controller.rb Introduces controller action for sitemap entrypoint based on current space.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread app/controllers/sitemaps_controller.rb
Comment thread app/controllers/sitemaps_controller.rb Outdated
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread test/models/space_test.rb
Comment thread config/sitemap.rb
Comment thread app/controllers/sitemaps_controller.rb
Comment thread test/integration/sitemap_test.rb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants