Titles to Slugs

For easy usage of the cref (Cross Reference) system, a consistent conversion from titles to slugs is desired. Therefore all titles should be converted to slugs as follows from now on and existing slugs should be corrected where needed:

  • All characters should be lowercase.
  • All spaces are converted to dashes.
  • Any repetitive dashes (due to converting spaces) are to be replaces by a single dash.
  • Ampersands (&) should be converted to ‘and’.
  • All non-alphanumeric characters that are not dashes are to be removed (dots, commas, various opening/closing brackets and quotation marks, exclamation points, question marks, etc.)
  • Special characters (i.e. French) are to be converted to normal characters.
  • The following should be removed from the slug start: “the”, “theme from”.

Examples of correct conversions:

  • L’Opera Sauvage = lopera-sauvage
  • Industrial Revolution, part 2 = industrial-revolution-part-2
  • Tubbs & Valerie = tubbs-and-valerie
  • Équinoxe = equinoxe
  • Theme from “Airwolf” = airwolf
  • The A-Team = a-team