Skip to content

feat: Adds sitemap generation #753

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

BenjaminMichaelis
Copy link
Member

@BenjaminMichaelis BenjaminMichaelis commented Jul 11, 2025

Implements sitemap generation instead of taking a generated sitemap from tooling.

  • Introduces DotnetSitemapGenerator package for creating sitemap XML.
  • Dynamically generates routes from controllers, excluding Identity routes.
  • Adds static routes and site mappings from content.
  • Ensures sitemap health by validating canonical links.

Part 1 of #754

Implements sitemap generation to improve SEO.

Adds a new service to extract static routes from the application's controllers and actions.  These routes are then used, along with content-based routes, to generate a sitemap.xml file in the wwwroot directory during application startup.

This helps search engines crawl and index the site more effectively.
@BenjaminMichaelis BenjaminMichaelis self-assigned this Jul 11, 2025
@BenjaminMichaelis BenjaminMichaelis changed the title Feat: Adds sitemap generation feat: Adds sitemap generation Jul 11, 2025
@BenjaminMichaelis BenjaminMichaelis requested a review from Keboo July 11, 2025 16:32
Ensures the initial logger is used when warning about a missing Application Insights connection string.
This provides a more accurate representation of the application's startup phase.
Updates the test class to use the correct WebApplicationFactory
type.

This ensures proper dependency injection and test setup.
Refactors sitemap XML generation to use a dedicated service for route configuration.

This change improves the sitemap generation process by:

- Introducing `IRouteConfigurationService` to centralize route retrieval and filtering logic.
- Excluding Identity, Index, and Error routes from the sitemap.
- Adding tests to validate sitemap generation.
- Configuring the base URL for sitemap generation through configuration.
- Ensuring sitemap health by validating canonical links.

This approach provides better control over the routes included in the sitemap and enhances the overall maintainability and testability of the sitemap generation process.
@BenjaminMichaelis BenjaminMichaelis enabled auto-merge (squash) July 12, 2025 20:11
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.

2 participants