Skip to content

Commit d50fe66

Browse files
fix: open in new tab for links (#22820)
## 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
1 parent 7a31d0c commit d50fe66

File tree

3 files changed

+19
-25
lines changed

3 files changed

+19
-25
lines changed

content/contribute/components/links.md

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,17 @@ toc_max: 3
66

77
## Examples
88

9-
- [External links](https://docker.com) open in a new tab
10-
- [Internal links](links.md) open in the same tab
9+
[External links](https://docker.com) and [internal links](links.md) both
10+
open in the same tab.
1111

12-
You can use relative links, using source filenames,
13-
or you can use absolute links for pages as they appear on the final site.
12+
Use relative links, using source filenames.
1413

1514
#### Links to auto-generated content
1615

17-
When you link to heading IDs in auto-generated pages, such as CLI reference content,
18-
you won't get any help from your editor in resolving the anchor names. That's
19-
because the pages are generated at build-time and your editor or LSP doesn't know
20-
about them in advance.
16+
When you link to heading IDs in auto-generated pages, such as CLI
17+
reference content, you won't get any help from your editor in resolving the
18+
anchor names. That's because the pages are generated at build-time and your
19+
editor or LSP doesn't know about them in advance.
2120

2221
## Syntax
2322

hugo_stats.json

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
"htmlElements": {
33
"tags": null,
44
"classes": [
5-
"!mt-0",
65
"--mount",
76
"--tmpfs",
87
"-mr-8",
@@ -33,20 +32,24 @@
3332
"Command-Prompt-CLI",
3433
"Compliant",
3534
"Custom-builder",
35+
"DNS-resolution",
3636
"Debian",
3737
"Debian-GNU/Linux",
3838
"Diff",
3939
"Docker-Desktop",
40+
"Docker-Engine",
4041
"Docker-Hub",
4142
"Docker-Scout-Dashboard",
42-
"Docker-plan",
43+
"Docker-subscription",
4344
"Download",
4445
"Entra-ID",
4546
"Entra-ID-SAML-2.0",
4647
"External-cloud-storage",
4748
"Fedora",
4849
"For-Mac-with-Apple-silicon",
4950
"For-Mac-with-Intel-chip",
51+
"From-Docker-Desktop",
52+
"From-the-Docker-CLI",
5053
"From-the-GUI",
5154
"From-the-command-line",
5255
"GUI",
@@ -65,8 +68,8 @@
6568
"JavaScript",
6669
"Jenkins",
6770
"Latest",
68-
"Legacy-Docker-plan",
6971
"Legacy-Docker-plans",
72+
"Legacy-Docker-subscription",
7073
"Linux",
7174
"Local-or-Hub-storage",
7275
"MDM",
@@ -80,6 +83,7 @@
8083
"Mac-with-Intel-chip",
8184
"Manually-create-assets",
8285
"NetworkManager",
86+
"Networking-mode",
8387
"Node",
8488
"Non-compliant",
8589
"Okta",
@@ -146,8 +150,8 @@
146150
"bg-amber-500",
147151
"bg-background-light",
148152
"bg-background-toc",
153+
"bg-black/100",
149154
"bg-black/50",
150-
"bg-black/70",
151155
"bg-blue",
152156
"bg-blue-400",
153157
"bg-blue-500",
@@ -445,7 +449,6 @@
445449
"overflow-x-auto",
446450
"overflow-x-hidden",
447451
"overflow-y-auto",
448-
"p-1",
449452
"p-2",
450453
"p-3",
451454
"p-4",
@@ -459,7 +462,6 @@
459462
"pb-20",
460463
"pb-4",
461464
"pb-8",
462-
"pl-1",
463465
"pl-2",
464466
"pl-3",
465467
"pl-4",
@@ -513,7 +515,6 @@
513515
"sm:hidden",
514516
"sm:items-center",
515517
"sm:w-full",
516-
"space-x-2",
517518
"space-y-2",
518519
"space-y-4",
519520
"sticky",
@@ -523,6 +524,9 @@
523524
"svg-container",
524525
"syntax-light",
525526
"systemd-networkd",
527+
"tab-item",
528+
"tablist",
529+
"tabs",
526530
"text-2xl",
527531
"text-base",
528532
"text-black",
Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,13 @@
11
{{ $url := .Destination }}
22
{{- if (strings.HasPrefix $url "http") -}}
3-
{{/* external link, add icon */}}
4-
<a class="link" href="{{ $url | safeURL }}" rel="noopener">
5-
{{ .Text | safeHTML }}
6-
<span class="pl-1 icon-svg icon-sm">
7-
{{ partialCached "icon" "open_in_new" "open_in_new" }}
8-
</span>
9-
</a>
3+
<a class="link" href="{{ $url | safeURL }}" rel="noopener">{{ .Text | safeHTML }}</a>
104
{{- else if (strings.HasPrefix $url "mailto:") -}}
11-
{{/* mailto link, render as normal link */}}
125
<a class="link" href="{{ $url }}">{{ .Text | safeHTML }}</a>
136
{{- else if (strings.HasPrefix $url "/") -}}
147
{{ if (strings.HasSuffix (urls.Parse $url).Path ".md") }}
15-
{{/* abs path to markdown file, use ref */}}
168
{{ $url = (ref page $url) }}
179
{{ end }}
1810
<a class="link" href="{{ $url }}">{{ .Text | safeHTML }}</a>
1911
{{- else -}}
20-
{{/* relative link, use ref */}}
2112
<a class="link" href="{{ ref page $url }}">{{ .Text | safeHTML }}</a>
2213
{{- end -}}

0 commit comments

Comments
 (0)