Page MenuHomeMusing Studio

Improve slug generation
Closed, ResolvedPublic

Description

Overview

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

Implementation

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.

Also:

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

All pages from my blog http://google.com

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

Revisions and Commits

rWF WriteFreely

Related Objects

StatusAssignedTask
Resolvedmatt

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 Snap.as image URL, like this one: https://www.processimagining.com/i-snap-as-xw7isae-jpg

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