Skip to content

Conversation

@jesseleite
Copy link
Contributor

@jesseleite jesseleite commented Jun 27, 2025

This PR adds support for enforcing trailing slashes on urls and links in generated SEO meta and in the sitemap. This is useful on server hosts that bias towards trailing slashes (ie. Netlify expects trailing slashes for SEO).

Todo

  • Add opt-in config
    • We're not going to offer a config for this at the SEO Pro level. If you need this for statamic/ssg purposes, you can enable it in ssg's config, or across your whole app via URL::enforceTrailingSlashes() in a provider, etc.
  • Flesh out test coverage
    • Everything seems to be working when testing manually though! 💅
  • Add to DOCUMENTATION.md
    • Explain that if you're wanting trailing slashes for statamic/ssg reasons (ie. Netlify), that you should probably use ssg's dedicated config or enable for your app via URL::enforceTrailingSlashes().

References #387
References statamic/cms#11840
References statamic/ssg#203

@jesseleite jesseleite changed the base branch from master to statamic-v6-support July 18, 2025 16:59
@jesseleite jesseleite marked this pull request as ready for review July 18, 2025 17:00
@jesseleite jesseleite merged commit 229d711 into statamic-v6-support Jul 18, 2025
28 checks passed
@jesseleite jesseleite deleted the enforce-trailing-slashes branch July 18, 2025 17:00
This was referenced Jul 18, 2025
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