Comments (14)
Regarding @Haraldson 's comment on daisy's diner
becoming daisys-diner
instead of daisy-s-diner
, I have an open PR for that in particular, #71 , just fyi for people in this thread.
from slugify.
Just out of curiosity as I'm a little bit confused about slug styles in general^^
What's the reason behind not supporting i18n?
I think it's important and as shown in the example by @idleberg replacing an ä
with a
doesn't really make sense in the resulting word to a german user.
So again, just asking, trying to form a picture of URL slugs and reasonings behind their various possible designs 😉 😁
from slugify.
I think a common expectation is to have non-alphanumerical symbols map to an empty string by default. Consider for instance a business name like Daisy’s Diner – I don’t want daisy-s-diner as my slug, but rather daisys-diner.
I agree with your specific example, but not that all non-alphanumerical symbols should be empty strings. Open a new issue with this and we can figure out a way to improve the output.
from slugify.
German umlauts (ä, ö, ü) and the letter ß (“sharp s”) are commonly replaced differently:
ä -> ae
ö -> oe
ü -> ue
ß -> ss
So maybe an option for these cases makes sense. If I'm not mistaken the ß
is replaced as sz
in Switzerland.
Other characters for special treament could be @
and %
.
from slugify.
So maybe an option for these cases makes sense. If I'm not mistaken the ß is replaced as sz in Switzerland.
I don't intend to internationalize this module, so the target is English.
Other characters for special treament could be @ and %.
👍
from slugify.
So german umlauts are properly replaced already and you don't intent to add support for the swiss variation in ß, that makes sense, if that's what you were saying. haha finally 👍
See my comment in #38 (comment).
from slugify.
@sindresorhus What do you think about removing filler words for better SEO? See https://www.reliablesoft.net/slug/
Read https://twitter.com/deadcoder0904/status/1424627186565193734 for TL;DR
Or should this be done manually? (which makes more sense tbf)
from slugify.
@CanRau Unicode slugs can be fine. It really depends on your constraints, both company-wise and tech stack wise. I'm happy to add an option to preserve Unicode characters. It's just not a common request.
https://en.wikipedia.org/wiki/Clean_URL#Slug
from slugify.
Hum, now I'm pretty confused and I think the conversation might be confused, too 😅
I thought, for whatever reason, that slugify
(this module here) replaces ä
-> a
but according to replacements.js#L6 it already does the right thing 😳I might've installed npm.im/slugify instead of @sindresorhus/slugify 🤣 what a shame. Now that I tried (again), that's the most likely^^
So german umlauts are properly replaced already and you don't intent to add support for the swiss variation in ß
, that makes sense, if that's what you were saying. haha finally 👍
I suffered for nothing 😆 Then I believe (it seems) only #37 would be missing for @sindresorhus/slugify to be the perfect slugger for me ❤️ 🤞
from slugify.
I think a common expectation is to have non-alphanumerical symbols map to an empty string by default. Consider for instance a business name like Daisy’s Diner – I don’t want daisy-s-diner
as my slug, but rather daisys-diner
.
(I half-expected each array in customReplacements
to be applied directly to String.replace
, but was unsuccessful in passing a regular expression as the first argument. If I could do [/\W/, '']
, much would be solved.)
from slugify.
It would be nice to have em dash —
replaced by a regular -
.
In many fonts there are hardly a visible difference which contributes to many copy paste "issues" from word processors.
from slugify.
Don't have any experience regarding em-dash though it sounds interesting 👏🏼
from slugify.
My comment was actually meant for the transliterate repo, but for some reason I mixed it up 🤷
That being said, I'm assuming that this sindresorhus/transliterate#11 would take care of my suggestion.
from slugify.
Uh yea I see, so seems that issue got kinda forgotten
from slugify.
Related Issues (20)
- All Caps cause incorrect dashes!
- Support multiple occurrences HOT 6
- Add an option to support leading underscores HOT 1
- Removing of '/' character HOT 1
- Extract transliteration into it's own library HOT 3
- Error: "Expected identifier, string or number" on Edge-18 HOT 6
- Transpiling to ES5 HOT 1
- Truncate string input? HOT 2
- Allow empty replacement HOT 1
- Make patternSlug customizable HOT 3
- dot "." is legal in a URL but it is replaced with "-" HOT 8
- Decamelization should ignore plurals of acronyms
- You may need an appropriate loader to handle this file type HOT 1
- Can we support chinese language? HOT 2
- Cannot use Slugify inside Jest tests HOT 2
- user password included when populate with user HOT 1
- [enhancement] Compund slugs HOT 2
- Error [ERR_REQUIRE_ESM]: require() of ES Module HOT 5
- Option disabling `transliterate`
- Contractions/possessions removal causes unwanted behavior
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slugify.