Implement slug styles (name TBD) #811
Open
+85
−22
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.
Slug styles specify how slugs are turned into file and directory names
in the URL path. This is roughly based off the design in
#809 (comment).
As is, this PR fixes #344 and deals with the tricky "global" part of
doing #809 properly. It also enables pages with dots in their slugs to
be paginated and fixes some issues with the dev server resolving
descendants of such pages incorrectly. It is still a prototype, though
(I have only done some casual manual testing and yet to write any
tests or documentation; wanted to get the overall design reviewed first).
In addition to a sitewide default setting and per-page setting, we would
likely also want datamodels to be able to specify the slug style of
their pages and/or their child pages. To stay similar to the current way
slug_format
can be configured, it seems we should also allowdatamodels to specify the slug styles of their children, but as
mentioend in #806 that behavior is a little strange and worth
reconsidering, so this PR doesn't try to implement any such behavior.
Issue(s) Resolved
Fixes #344
Related Issues / Links
#809, #806
Description of Changes