Created
August 28, 2020 06:49
-
-
Save piotrpog/d8c29ec505b0fb6e35b7cf23a05c7eb9 to your computer and use it in GitHub Desktop.
Pretty URL Twig Macro
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% 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