mirror of https://github.com/docker/docs.git
fix: use links with leading slash as-is
Links that started with a slash were being prepended the URL hostname and rendered as absolute links before. This caused our link checker to miss broken links that contained a leading slash. This change fixes this issue by rendering links with a leading slash as-is, without modification. Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
parent
1598774c9c
commit
2eb97d7fe7
|
@ -12,8 +12,8 @@
|
|||
></a
|
||||
>
|
||||
{{- else if (strings.HasPrefix $url "/") -}}
|
||||
{{/* absolute link, use absURL */}}
|
||||
<a class="link" href="{{ absURL $url }}">{{ .Text | safeHTML }}</a>
|
||||
{{/* absolute link, use url as-is */}}
|
||||
<a class="link" href="{{ $url }}">{{ .Text | safeHTML }}</a>
|
||||
{{- else -}}
|
||||
{{/* check if the file links to index.md */}}
|
||||
{{- if (strings.FindRE `([^_]|^)index.md` $url 1) -}}
|
||||
|
|
Loading…
Reference in New Issue