Giter VIP home page Giter VIP logo

Comments (14)

aegatlin avatar aegatlin commented on June 4, 2024 3

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.

CanRau avatar CanRau commented on June 4, 2024 2

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.

sindresorhus avatar sindresorhus commented on June 4, 2024 2

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.

idleberg avatar idleberg commented on June 4, 2024 1

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.

sindresorhus avatar sindresorhus commented on June 4, 2024 1

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.

sindresorhus avatar sindresorhus commented on June 4, 2024 1

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.

deadcoder0904 avatar deadcoder0904 commented on June 4, 2024 1

@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.

sindresorhus avatar sindresorhus commented on June 4, 2024

@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.

CanRau avatar CanRau commented on June 4, 2024

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.

Haraldson avatar Haraldson commented on June 4, 2024

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.

fannarsh avatar fannarsh commented on June 4, 2024

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.

CanRau avatar CanRau commented on June 4, 2024

Don't have any experience regarding em-dash though it sounds interesting 👏🏼

from slugify.

fannarsh avatar fannarsh commented on June 4, 2024

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.

CanRau avatar CanRau commented on June 4, 2024

Uh yea I see, so seems that issue got kinda forgotten

from slugify.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.