Enable runtime switching of blog permalink formats#780
Merged
Conversation
Refactor routing to support both unique (date-prefixed) and non-unique (title-only) blog post permalinks, using a new TitlePermaLinkUniqueConstraint that checks the setting at request time. Register all route patterns at startup, guarded by the constraint, allowing runtime toggling of permalink style and space replacement without app restart. Add integration tests to verify dynamic link and routing behavior. Improve null handling in BlogManager.GetBlogPost. Expose HostServices for testing.
Removed the TitlePermaLinkUniqueConstraint and its registration, allowing both date-prefixed and title-only permalinks to always resolve regardless of the EnableTitlePermaLinkUnique setting. Updated route definitions and tests accordingly. The setting now only controls which link format is generated, not which URLs are accepted. Cleaned up related code and project structure.
Enhanced GetBlogPost to better normalize post titles for permalink matching, handling both non-unique and unique (date-prefixed) formats. Expanded Playwright tests to verify both permalink styles and navigation. Removed obsolete Routing folder from project file.
Removed all support for configurable space replacement in permalinks and categories. The separator is now always "-", with related config, UI, and tests deleted or refactored. This simplifies URL handling and eliminates the option to use "+".
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Enable runtime switching of blog permalink formats
Refactor routing to support both unique (date-prefixed) and non-unique (title-only) blog post permalinks, using a new TitlePermaLinkUniqueConstraint that checks the setting at request time. Register all route patterns at startup, guarded by the constraint, allowing runtime toggling of permalink style and space replacement without app restart. Add integration tests to verify dynamic link and routing behavior. Improve null handling in BlogManager.GetBlogPost. Expose HostServices for testing.