Repository navigation
Slugs not working as expected #1133
Replies: 3 comments 1 reply
|
I’ll check the first issue. The second issue is not a bug. |
|
I suspect you added the |
|
v0.259.0 added the |
|
I’ll check the first issue. The second issue is not a bug. |
|
I suspect you added the |
|
v0.259.0 added the |
Uh oh!
There was an error while loading. Please reload this page.
I'm having a few issues with the slugify functionality of Sveltia--specifically, the top-level
slugconfiguration and hidden widget fields.First issue:
Given a collection item with a title containing special characters, such as "Keybjört", Sveltia generates a slug of
keybjörtand creates the filekeybjört.md. I'd like to avoid non-ASCII characters in my filenames, so I've added the following top-level configuration to generate ASCII-only slugs:When testing this configuration using the local development workflow, there is no change. The slug remains
keybjört, and the same filename is output to the source directory.Second issue:
For whatever reason, the slug template tag doesn't work at all in hidden widget fields.
The following field…
… produces this output in the item's front matter.
This, of course, breaks everything, since it would result in every collection item having the same permalink. The same template tag does correctly output a slug when used in the
preview_pathfield.I've only tested these with the local development workflow, so I'm not sure if the problems might be specific to that particular environment.
Is there something that I've overlooked here? 🤔 It would be great to enable item preview URLs for this client site, but I'm not sure how to do that without either:
permalink: portfolio/\{{ title | slugify }}/index.html) to permalinks that use Sveltia's slug generation, orpreview_path, which would generate the same slugs as Eleventy. (Eleventy uses @sindresorhus/slugify for itsslugifyfilter, which transliterates Unicode characters rather than mapping them to similar ASCII ones.)Thanks in advance for taking a look!
All reactions