Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does "slug" mean [duplicate]

Possible Duplicate:
What is the etymology of 'slug'?

In CouchDB definitive guide the author used key "slug" in a document.

{    "title": "Hello World",    "slug": "hello_world" } 

What does "slug" mean and why is it used?

like image 207
ajsie Avatar asked Dec 05 '10 02:12

ajsie


People also ask

What does slug mean in it?

A Slug is the unique identifying part of a web address, typically at the end of the URL. In the context of MDN, it is the portion of the URL following "<locale>/docs/". It may also just be the final component when a new document is created under a parent document; for example, this page's slug is Glossary/Slug .

What does slug mean in database?

A slug is a human-readable, unique identifier, used to identify a resource instead of a less human-readable identifier like an id . You use a slug when you want to refer to an item while preserving the ability to see, at a glance, what the item is.


1 Answers

A slug is an alternative to a name that would otherwise not be acceptable for various reasons - e.g. containing special characters, too long, mixed-case, etc. - appropriate for the target usage. What target usage means is context dependent, but could include usage in a URL or name of a file or database table for example. In the general case a slug may be composed from a combination of multiple fields; in the above case, only one field is used - title.

Have a look at these SOqs, too:

  • What is a "slug" in Django?
  • Replacing %20 with a Dash

If you are into the origin of the term, see this:

  • What is the etymology of 'slug'?
like image 97
icyrock.com Avatar answered Oct 07 '22 01:10

icyrock.com