mirror of https://github.com/docker/docs.git
hugo: don't rewrite index.md links in render hook
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
parent
6e4790e291
commit
554aaabb1f
|
@ -17,17 +17,6 @@
|
||||||
{{ end }}
|
{{ end }}
|
||||||
<a class="link" href="{{ $url }}">{{ .Text | safeHTML }}</a>
|
<a class="link" href="{{ $url }}">{{ .Text | safeHTML }}</a>
|
||||||
{{- else -}}
|
{{- else -}}
|
||||||
{{/* check if the file links to index.md */}}
|
{{/* relative link, use ref */}}
|
||||||
{{- if (strings.FindRE `([^_]|^)index.md` $url 1) -}}
|
<a class="link" href="{{ ref page $url }}">{{ .Text | safeHTML }}</a>
|
||||||
<a
|
|
||||||
class="link"
|
|
||||||
href="{{ ref page (strings.Replace $url "index.md" "_index.md") }}"
|
|
||||||
>{{ .Text | safeHTML }}</a
|
|
||||||
>
|
|
||||||
{{- else -}}
|
|
||||||
{{/* relative link, use ref */}}
|
|
||||||
<a class="link" href="{{ ref page $url }}"
|
|
||||||
>{{ .Text | safeHTML }}</a
|
|
||||||
>
|
|
||||||
{{- end -}}
|
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
Loading…
Reference in New Issue