Last active
January 24, 2020 21:44
-
-
Save timkelty/85b474df5faaa41c45a1a509cc9a25cf to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| {% set text = text ?? 'Learn More' %} | |
| {% set external = external ?? false %} | |
| {% set target = attrs.target ?? (external ? '_blank') %} | |
| {# Passed attrs take precedence #} | |
| {% set attrs = { | |
| href: href ?? url ?? '#', | |
| target: target, | |
| rel: target|lower == '_blank' ? 'noreferrer noopener', | |
| }|merge(attrs ?? {}) %} | |
| <a {{ attr(attrs) }}> | |
| {% block main %} | |
| {{ text }} | |
| {% endblock %} | |
| </a> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment