Open selrond opened 5 years ago
We trim consequent dashes as they're generally not wanted, but subsequent dashes specified in the slug template should be respected, agreed.
First time contributor - hope I did ok!
I mentioned this on @adamwatters' (awesome) PR, but I missed that this will be a breaking change, as folks' build systems will be configured to handle slugs in the current way. I happened to run into this issue in the deploy preview links PR (#2028), which introduces preview_path
, a field that works exactly the same as slug
. It was critical for static parts of preview_path
to be completely untouched - turned out that addressing this was nowhere near as simple as I thought.
I introduced the path forward in the PR mentioned above, and we'll transition slug
to work the same way in 3.0, which is not too far off.
@selrond happy to help you find a workaround - maybe instead of ---
as a separator you can use something like -_-
? It's ugly, but maybe it could do the trick for now?
@erquhart well, that's unfortunate... I've settled on ___
(three underscores) but this definitely needs to get addressed or at least clearly documented - it's doing something unexpected with no obvious explanation
Agreed, documenting would help until 3.0, would accept a PR if anyone is up for adding.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Describe the bug
When using multiple dashes in slug template of folder collections like this:
newly created articles have one dash instead of three (as one would hope).
To Reproduce
Just use the slug template provided above
Expected behavior
I expect slug to be
2019_01_15_08_20_12---sample-article.md
but I'm getting
2019_01_15_08_20_12-sample-article.md
Screenshots
Applicable Versions:
Additional context
This is crucial for me, as I do some string manipulations to generate prettier filenames in Gatsby.