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
Add slugify.paths_keep_dates option. Update docs. #1955
Conversation
Can you rebase the PR? |
(oops, deleted the next branch in my fork when I synced it) Rebased. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you will need to rebase the commit again, sorry.
It looks ok except I would have preferred if the setting was section-wide rather than config-wide to make it more specific.
# Whether to remove date prefixes for page path slugs. | ||
# For example, content/posts/2016-10-08_a-post-with-dates.md => posts/a-post-with-dates | ||
# When true, content/posts/2016-10-08_a-post-with-dates.md => posts/2016-10-08-a-post-with-dates | ||
paths_keep_dates = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just bike shedding on the name: anyone has a better name? I'm not too sold on this one
Manual testing: Existing test_site/config.toml http://127.0.0.1:1111/posts/a-post-with-dates ==== --- a/test_site/config.toml +++ b/test_site/config.toml @@ -18,6 +18,7 @@ extra_syntaxes_and_themes = ["syntaxes", "highlight_themes"] [slugify] paths = "on" +paths_keep_dates = true taxonomies = "on" anchors = "on" http://127.0.0.1:1111/posts/2016-10-08-a-post-with-dates ==== --- a/test_site/config.toml +++ b/test_site/config.toml @@ -17,7 +17,8 @@ highlight_theme = "custom_gruvbox" extra_syntaxes_and_themes = ["syntaxes", "highlight_themes"] [slugify] -paths = "on" +paths = "off" +paths_keep_dates = true taxonomies = "on" anchors = "on" http://127.0.0.1:1111/posts/2016-10-08_a-post-with-dates ==== --- a/test_site/config.toml +++ b/test_site/config.toml @@ -17,7 +17,8 @@ highlight_theme = "custom_gruvbox" extra_syntaxes_and_themes = ["syntaxes", "highlight_themes"] [slugify] -paths = "on" +paths = "safe" +paths_keep_dates = true taxonomies = "on" anchors = "on" http://127.0.0.1:1111/posts/2016-10-08_a-post-with-dates
Rebased again. I'm happy to change the name if we have a better candidate :) |
Yep, we have time |
Manual testing:
Existing test_site/config.toml
http://127.0.0.1:1111/posts/a-post-with-dates
====
http://127.0.0.1:1111/posts/2016-10-08-a-post-with-dates
====
http://127.0.0.1:1111/posts/2016-10-08_a-post-with-dates
====
http://127.0.0.1:1111/posts/2016-10-08_a-post-with-dates
Sanity check:
Have you checked to ensure there aren't other open Pull Requests for the same update/change?
Are you doing the PR on the
next
branch?Have you created/updated the relevant documentation page(s)?
Proposal thread:
https://zola.discourse.group/t/proposal-config-option-to-keep-dates-in-slugs/1405