Skip to content

Instantly share code, notes, and snippets.

@piotrpog
Created August 28, 2020 06:49
Show Gist options
  • Save piotrpog/d8c29ec505b0fb6e35b7cf23a05c7eb9 to your computer and use it in GitHub Desktop.
Save piotrpog/d8c29ec505b0fb6e35b7cf23a05c7eb9 to your computer and use it in GitHub Desktop.
Pretty URL Twig Macro
{% macro prettyUrl(url) %}
{{url
|trim('https://', 'left')
|trim('http://', 'left')
|trim('www.', 'left')
|trim('/', 'right')
}}
{% endmacro %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment