14 lines
516 B
HTML
14 lines
516 B
HTML
{{- $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 */ -}}
|