Skip to content
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

Implement slug styles (name TBD) #811

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

betaveros
Copy link

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 allow
datamodels 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

  • Wrote at least one-line docstrings (for any new functions)
  • Added unit test(s) covering the changes (if testable)
  • Link to corresponding documentation pull request for getlektor.com

Slug styles specify how slugs are turned into file and directory names
in the URL path. This is roughly based off the design in
lektor#809 (comment).

As is, this PR fixes lektor#344 and deals with the tricky "global" part of
doing lektor#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).

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 allow
datamodels to specify the slug styles of their children, but as
mentioend in lektor#806 that behavior is a little strange and worth
reconsidering, so this PR doesn't try to implement any such behavior.
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.

Allow directory names with dot and file names without extension
1 participant