mirror of
https://github.com/docker/docs.git
synced 2026-03-28 23:08:49 +07:00
## Description - Update Contribute `links.md` to verify that internal and external links open in the same tab. - Remove "open in new" tab icon ## Related issues or tickets https://docker.atlassian.net/browse/ENGDOCS-2717 ## Reviews - [ ] Technical review - [ ] Editorial review - [ ] Product review
14 lines
582 B
HTML
14 lines
582 B
HTML
{{ $url := .Destination }}
|
|
{{- if (strings.HasPrefix $url "http") -}}
|
|
<a class="link" href="{{ $url | safeURL }}" rel="noopener">{{ .Text | safeHTML }}</a>
|
|
{{- else if (strings.HasPrefix $url "mailto:") -}}
|
|
<a class="link" href="{{ $url }}">{{ .Text | safeHTML }}</a>
|
|
{{- else if (strings.HasPrefix $url "/") -}}
|
|
{{ if (strings.HasSuffix (urls.Parse $url).Path ".md") }}
|
|
{{ $url = (ref page $url) }}
|
|
{{ end }}
|
|
<a class="link" href="{{ $url }}">{{ .Text | safeHTML }}</a>
|
|
{{- else -}}
|
|
<a class="link" href="{{ ref page $url }}">{{ .Text | safeHTML }}</a>
|
|
{{- end -}}
|