slug
This article is a stub. You can help the IndieWeb wiki by expanding it with relevant information.
A slug is a series of words in a permalink URL, usually at the end, that are from or representative of the name or text of a post, and thus part of an overall URL design. Slugs are often automatically generated based on the post name, replacing spaces with hyphens and accented characters with English alphabet characters, sometimes edited by the author.
Generally this article needs to be expanded with material from URL_design#Topic, and leave behind summaries in-place there.
Why
This section is a stub. You can help the IndieWeb wiki by expanding it.
You should use good optional slugs in your permalinks because URLs are part of the user interface (UI).
As long as people share URLs in plain text communications (which is likely forever), URLs are a part of the language people read, and thus adding relevant or key words to a permalink helps the reader decide whether a link is worth viewing or not.
Why optional
This section is a stub. You can help the IndieWeb wiki by expanding it.
All slugs SHOULD only be optional for the reader/browser, or why slugs MUST NOT be a required part of your permalinks:
- Long slugs may break, e.g. a Guardian article URL being broken when copy/pasted from a browser address bar into Slack: https://chat.indieweb.org/2021-03-15#t1615849807595000
- "^ this is a great example of why your slug should not be an essential part of your permalink" @[tantek] March 15, 2021
How
This section is a stub. You can help the IndieWeb wiki by expanding it.
See: URL_design#Topic and use it to expand this section with how to tips.
How not to
- Don't end a slug with a preposition, adjective, or possessive. Doing so may result something like:
- https://lostinhaste.com/2024/02/25/the-perils-of.html which reads like The Perils of HTML which it absolutely is not about
IndieWeb Examples
This section is a stub. You can help the IndieWeb wiki by expanding it.
Add yourself!
Add yourself hereโฆ (see this for more details)
Software Examples
This section is a stub. You can help the IndieWeb wiki by expanding it.
- WordPress creates a slug automatically but lets you edit it.
Other Examples
This section is a stub. You can help the IndieWeb wiki by expanding it.
Interesting illustrative examples from other sites.
- The Independent: very long full sentence quotation slug: https://www.the-independent.com/arts-entertainment/tv/features/stellan-skarsgard-interview-in-scandinavia-you-have-female-characters-that-would-be-hard-to-invent-in-a-more-repressed-sexist-society-like-britain-a6677191.html
- ...
Brainstorming
- brainstorming: https://chat.indieweb.org/dev/2023-06-02/1685735975968900
- "capjamesg: one of my thoughts that's been in the back of my mind for a while is to automatically generate a slug for my posts. Right now, I've been finding myself manually choosing slugs that are 1-2 words, based on the most significant words in the post" @aaronpk June 2, 2023
- ^ more: https://chat.indieweb.org/dev/2023-06-02/1685736065072400
- "i think my rough heuristic is: use a hashtag for the post if there's a hashtag in the text. then use the most unique proper noun." @aaronpk June 2, 2023
- ^ more: https://chat.indieweb.org/dev/2023-06-02/1685736313651400
- "i've been thinking about this for a while, because basically every time i post something, i choose a slug for it, so i've been paying attention to my own rules I use for finding a slug that I want for the post" @aaronpk June 2, 2023
