What does “slug” mean [duplicate]

淺唱寂寞╮ 提交于 2020-05-09 18:32:05

问题


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?


回答1:


Slug is used to make a name that is not 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 in general case slug is a more appropriate combination of other 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'?


来源:https://stackoverflow.com/questions/4357007/what-does-slug-mean

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!