Skip to content

Commit 554aaab

Browse files
committed
hugo: don't rewrite index.md links in render hook
Signed-off-by: David Karlsson <[email protected]>
1 parent 6e4790e commit 554aaab

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

layouts/_default/_markup/render-link.html

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,6 @@
1717
{{ end }}
1818
<a class="link" href="{{ $url }}">{{ .Text | safeHTML }}</a>
1919
{{- else -}}
20-
{{/* check if the file links to index.md */}}
21-
{{- if (strings.FindRE `([^_]|^)index.md` $url 1) -}}
22-
<a
23-
class="link"
24-
href="{{ ref page (strings.Replace $url "index.md" "_index.md") }}"
25-
>{{ .Text | safeHTML }}</a
26-
>
27-
{{- else -}}
28-
{{/* relative link, use ref */}}
29-
<a class="link" href="{{ ref page $url }}"
30-
>{{ .Text | safeHTML }}</a
31-
>
32-
{{- end -}}
20+
{{/* relative link, use ref */}}
21+
<a class="link" href="{{ ref page $url }}">{{ .Text | safeHTML }}</a>
3322
{{- end -}}

0 commit comments

Comments
 (0)