Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions content/contribute/components/links.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,17 @@

## Examples

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

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

#### Links to auto-generated content

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

Check warning on line 19 in content/contribute/components/links.md

View workflow job for this annotation

GitHub Actions / vale

[vale] reported by reviewdog 🐶 [Docker.Acronyms] 'LSP' has no definition. Raw Output: {"message": "[Docker.Acronyms] 'LSP' has no definition.", "location": {"path": "content/contribute/components/links.md", "range": {"start": {"line": 19, "column": 11}}}, "severity": "WARNING"}

## Syntax

Expand Down
18 changes: 11 additions & 7 deletions hugo_stats.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
"htmlElements": {
"tags": null,
"classes": [
"!mt-0",
"--mount",
"--tmpfs",
"-mr-8",
Expand Down Expand Up @@ -33,20 +32,24 @@
"Command-Prompt-CLI",
"Compliant",
"Custom-builder",
"DNS-resolution",
"Debian",
"Debian-GNU/Linux",
"Diff",
"Docker-Desktop",
"Docker-Engine",
"Docker-Hub",
"Docker-Scout-Dashboard",
"Docker-plan",
"Docker-subscription",
"Download",
"Entra-ID",
"Entra-ID-SAML-2.0",
"External-cloud-storage",
"Fedora",
"For-Mac-with-Apple-silicon",
"For-Mac-with-Intel-chip",
"From-Docker-Desktop",
"From-the-Docker-CLI",
"From-the-GUI",
"From-the-command-line",
"GUI",
Expand All @@ -65,8 +68,8 @@
"JavaScript",
"Jenkins",
"Latest",
"Legacy-Docker-plan",
"Legacy-Docker-plans",
"Legacy-Docker-subscription",
"Linux",
"Local-or-Hub-storage",
"MDM",
Expand All @@ -80,6 +83,7 @@
"Mac-with-Intel-chip",
"Manually-create-assets",
"NetworkManager",
"Networking-mode",
"Node",
"Non-compliant",
"Okta",
Expand Down Expand Up @@ -146,8 +150,8 @@
"bg-amber-500",
"bg-background-light",
"bg-background-toc",
"bg-black/100",
"bg-black/50",
"bg-black/70",
"bg-blue",
"bg-blue-400",
"bg-blue-500",
Expand Down Expand Up @@ -445,7 +449,6 @@
"overflow-x-auto",
"overflow-x-hidden",
"overflow-y-auto",
"p-1",
"p-2",
"p-3",
"p-4",
Expand All @@ -459,7 +462,6 @@
"pb-20",
"pb-4",
"pb-8",
"pl-1",
"pl-2",
"pl-3",
"pl-4",
Expand Down Expand Up @@ -513,7 +515,6 @@
"sm:hidden",
"sm:items-center",
"sm:w-full",
"space-x-2",
"space-y-2",
"space-y-4",
"sticky",
Expand All @@ -523,6 +524,9 @@
"svg-container",
"syntax-light",
"systemd-networkd",
"tab-item",
"tablist",
"tabs",
"text-2xl",
"text-base",
"text-black",
Expand Down
11 changes: 1 addition & 10 deletions layouts/_default/_markup/render-link.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
{{ $url := .Destination }}
{{- if (strings.HasPrefix $url "http") -}}
{{/* external link, add icon */}}
<a class="link" href="{{ $url | safeURL }}" rel="noopener">
{{ .Text | safeHTML }}
<span class="pl-1 icon-svg icon-sm">
{{ partialCached "icon" "open_in_new" "open_in_new" }}
</span>
</a>
<a class="link" href="{{ $url | safeURL }}" rel="noopener">{{ .Text | safeHTML }}</a>
{{- else if (strings.HasPrefix $url "mailto:") -}}
{{/* mailto link, render as normal link */}}
<a class="link" href="{{ $url }}">{{ .Text | safeHTML }}</a>
{{- else if (strings.HasPrefix $url "/") -}}
{{ if (strings.HasSuffix (urls.Parse $url).Path ".md") }}
{{/* abs path to markdown file, use ref */}}
{{ $url = (ref page $url) }}
{{ end }}
<a class="link" href="{{ $url }}">{{ .Text | safeHTML }}</a>
{{- else -}}
{{/* relative link, use ref */}}
<a class="link" href="{{ ref page $url }}">{{ .Text | safeHTML }}</a>
{{- end -}}