{% macro slugify(text) %} {%- set result = text | lower | replace('[^a-z0-9]+', '-') | replace('-+', '-') | trim -%} {%- endmacro %}