import re


def slugify(u):
    """Convert Unicode string into blog slug."""
    # From https://leancrew.com/all-this/2014/10/asciifying/

    u = re.sub(u'[–—/:;,.]', '-', u)  # replace separating punctuation
    a = u.lower()  # best ASCII substitutions, lowercased
    a = re.sub(r'[^a-z0-9 -]', '', a)  # delete any other characters
    a = a.replace(' ', '-')  # spaces to hyphens
    a = re.sub(r'-+', '-', a)  # condense repeated hyphens
    return a