From fefa22b36f2e1da10411068a8ae9fbd7d4537d89 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 16 Dec 2025 13:44:06 +0100 Subject: [PATCH 1/2] transliterate special chars --- slugify | 2 ++ 1 file changed, 2 insertions(+) diff --git a/slugify b/slugify index 4fd2724..eebf6a1 100755 --- a/slugify +++ b/slugify @@ -25,6 +25,8 @@ to_slug() { # Forcing the POSIX local so alnum is only 0-9A-Za-z export LANG=POSIX export LC_ALL=POSIX + #transliterate special chars + iconv -f UTF-8 -t ASCII//TRANSLIT | # Keep only alphanumeric value sed -e 's/[^[:alnum:]]/-/g' | # Keep only one dash if there is multiple one consecutively From a288cb9bafcd22e70c85434868d40bc90feba750 Mon Sep 17 00:00:00 2001 From: David Date: Tue, 16 Dec 2025 13:51:22 +0100 Subject: [PATCH 2/2] remove ' instead of replacing it with - this might be kind of opinionated, but I like it better if ' is removed instead of replaced, so that e.g. "don't" will be slugified to "dont" instead of "don-t" --- slugify | 2 ++ 1 file changed, 2 insertions(+) diff --git a/slugify b/slugify index 4fd2724..a34c985 100755 --- a/slugify +++ b/slugify @@ -25,6 +25,8 @@ to_slug() { # Forcing the POSIX local so alnum is only 0-9A-Za-z export LANG=POSIX export LC_ALL=POSIX + #replace ' with nothing + sed -e "s/[\']//g" | # Keep only alphanumeric value sed -e 's/[^[:alnum:]]/-/g' | # Keep only one dash if there is multiple one consecutively