Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@piotrpog
Last active June 21, 2019 13:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save piotrpog/b665396e625b19459f98999ad161225b to your computer and use it in GitHub Desktop.
Save piotrpog/b665396e625b19459f98999ad161225b to your computer and use it in GitHub Desktop.
Phone number macro - this macro strips unnesesary haracters from phone numbers and generates "phone links.
{% macro phoneNumber(phoneNumber) %}
<a href="tel:{{ phoneNumber|replace({'-':'', ' ':'', '.':'', '(':'', ')':''}) }}">{{ phoneNumber }}</a>
{% endmacro %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment