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)