slug
This article is a stub. You can help the IndieWeb wiki by expanding it.
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.
Why
This section is a stub. You can help the IndieWebCamp 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 IndieWebCamp 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 IndieWebCamp wiki by expanding it.
See: URL_design#Topic for now
This section can/should be expanded with immediately inline how to tips, perhaps with ideas from URL_design#Topic.
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
Add yourself!
Add yourself here⦠(see this for more details)
Software Examples
- WordPress creates a slug automatically but lets you edit it.
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