def truncate(content, length=100, suffix="..."):
    """
    Smart string truncation
    """
    if len(content) <= length:
        return content
    else:
        return content[:length].rsplit(" ", 1)[0] + suffix