Slugification

Really HARD topic to decide. Slugification aims at creating a string with correct balance between human readibility and URI compatibility... The whole literature around doing this, generally describes two approaches:

  1. transliteration : TRIES to translate strings into a corresponding latin equivalent.

This results in HEAVY packages and somewhat magical translations not always obvious.

  1. Escaping : escapes non-latin characters to comply with URI sepcs

    too radical solution, and output slug can look funky or empty J'aime la Crème Brulée 繁體中文 ş Д 🐎 becoming: J-'-aime-la-Crme-Brule

In Troglio we promote another approach: leave output slug as close as possible to the input while helping with minimal corrections. The idea is to replace accents and diatrics, replace spaces by one '-', eliminate punctuation and leave the rest as-is. Ex: J'aime la Crème Brulée 繁體中文 ş Д 🐎 should become: jaime-la-creme-brulee-繁體中文-s-Д-🐎 > What You See Is What You Get : we only remove accents, diatrics, and punctuation. Then whitespaceS are replaced by one '-'. And everything is lowerCased. That's it. > we do not want to arbitrarily delete/escape special characters and leave user short disoriented about the output > it ultimately turns translation into user's responsibility: if it needs translation, the permalink property is still editable to do so and will have priority over automatic slug. So one can always define permalink = /this-is-my-final-manually-slugified-url.