Compare commits
2 Commits
a4bff7623d
...
25e9057dd8
Author | SHA1 | Date | |
---|---|---|---|
25e9057dd8 | |||
e431a4f22b |
|
@ -149,6 +149,15 @@ a {
|
|||
color: $primary-color;
|
||||
transition: color 0.25s;
|
||||
}
|
||||
|
||||
&.external-link {
|
||||
.feather {
|
||||
fill: none;
|
||||
margin-left: 0.25rem;
|
||||
position: relative;
|
||||
top: 0.125em;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
img {
|
||||
|
|
13
layouts/_default/_markup/render-link.html
Normal file
13
layouts/_default/_markup/render-link.html
Normal file
|
@ -0,0 +1,13 @@
|
|||
{{- $absoluteDest := absLangURL .Destination -}}
|
||||
{{- $siteRootUrl := absLangURL "" -}}
|
||||
{{- $isExternal := not (hasPrefix $absoluteDest $siteRootUrl) -}}
|
||||
<a href="{{ .Destination | safeURL }}"
|
||||
{{- with .Title }} title="{{ . }}"{{ end -}}
|
||||
{{- if $isExternal -}}
|
||||
class="external-link" target="_blank" rel="noopener noreferrer"
|
||||
{{- end -}}
|
||||
>
|
||||
{{- with .Text | safeHTML }}{{ . }}{{ end -}}
|
||||
{{- if $isExternal -}}{{- partial "icon.html" "external-link" -}}{{- end -}}
|
||||
</a>
|
||||
{{- /* chomp trailing newline */ -}}
|
Loading…
Reference in New Issue
Block a user