Last active
January 4, 2020 10:03
-
-
Save inwardmovement/680ecaceb42cae055db7c10257a78ffe to your computer and use it in GitHub Desktop.
Add external link icon with Hugo (using CSS)
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
<style> | |
a[href^="http"]:not([href^="{{ (urls.Parse .Page.Permalink).Scheme }}://{{ (urls.Parse .Page.Permalink).Host }}"]):not(.no-external-icon)::after | |
{ | |
content: 'launch'; | |
padding-left: 4px; | |
position: inline-block; | |
font-family: 'Material Icons'; | |
font-weight: normal; | |
font-style: normal; | |
font-size: 18px; | |
/* display: inline-block; prevent nbsp bypass */ | |
line-height: 1; | |
text-transform: none; | |
letter-spacing: normal; | |
word-wrap: normal; | |
white-space: nowrap; | |
direction: ltr; | |
-webkit-font-smoothing: antialiased; | |
text-rendering: optimizeLegibility; | |
-moz-osx-font-smoothing: grayscale; | |
font-feature-settings: 'liga'; | |
vertical-align: text-bottom; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment