Improve slug generation
Closed, ResolvedPublic



Right now, generated slugs are pretty lengthy. We should continue to support this length, but make it smarter.


Look for the following occurrences before the maximum slug length for logical places to end slugs:

  • First period, interrogation mark, exclamation point.
  • First line break

Otherwise, end at the space character closest to, but before, the maximum length.

Note: be mindful of periods, commas, etc. in numbers and URLs.


  • Exclude URLs from slugs where possible, e.g. a post that is just:

All pages from my blog

  • Exclude HTML tag contents, e.g. <h1>Post title</h1> becomes h1-post-title-h1 (T426)

Revisions and Commits

rWF WriteFreely

Related Objects


Event Timeline

matt added a subtask: Restricted Maniphest Task.Feb 14 2017, 5:27 AM
matt updated the task description. (Show Details)
matt closed subtask Restricted Maniphest Task as Resolved.Sep 8 2017, 1:40 AM

This is pretty solid now and covers most cases. Marking resolved.

One more case to solve: when a post begins with a image URL, like this one:

matt raised the priority of this task from Normal to High.Jan 21 2018, 4:48 AM
matt lowered the priority of this task from High to Normal.May 20 2019, 2:27 PM
matt changed the visibility from "Restricted Project (Project)" to "Public (No Login Required)".Oct 7 2020, 5:27 PM
matt changed the edit policy from "Restricted Project (Project)" to "All Users".
matt added a commit: Restricted Diffusion Commit.Dec 22 2021, 4:33 AM