Strip date from directory slugs when calculating page.fileSlug#2111
Conversation
66f517e to
2488ab1
Compare
|
Agree with this one but (as you said in #1947) it is a breaking change, so it will need to wait until 2.0—sorry! |
|
This would be great for a 2.0 release. Sorry to barge in like this, but wouldn’t this (only) make sense if images and other assets were supported in the content folders—particularly for people coming from other SSGs like Hugo or Jekyll. This would resolve #1140 and many other issues, I guess. Thanks, guys! |
|
@zachleat Is there anything I can do to reduce the impact of merging this PR? Would it be better if we added a new flag to 11ty to opt into this behavior? If so, any pointers on where I should look for that and how to mock it in tests? |
|
Merging this one! It’ll ship with 2.0.0-canary.10. Thank you @AleksandrHovhannisyan! |
page.fileSlug
|
For future visitors curious about |
|
It would be helpful to strip date from filename if it is separated from title by
|
|
Can I disable this? I actually want the slugs to match my filenames and not do anything I didn't ask for. |
Closes #1947
2021-11-20-my-awesome-post/index.mdgets a slug ofmy-awesome-postrather than2021-11-20-my-awesome-post.