Skip to content

Commit 98d19b8

Browse files
authored
Make menu entries' link relative (mmcgrana#421)
This change allows hugo to build pages correcly when `canonifyURLs = false` and `relativeURLs = true`. Otherwise the links on the menu will be canonicalized regardless of configuration. This results in broken sites in a number of situations, such as sites served behind a reverse-proxy that don't want to account for the prefix they're served under.
1 parent 5581ec0 commit 98d19b8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

layouts/partials/docs/menu-filetree.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@
3131
{{ if .Page.Params.bookCollapseSection }}
3232
<input type="checkbox" id="section-{{ md5 .Page }}" class="toggle" {{ if or $current $ancestor }}checked{{ end }} />
3333
<label for="section-{{ md5 .Page }}" class="flex justify-between">
34-
<a {{ if .Page.Content }}href="{{ .Page.Permalink }}"{{ else }}role="button"{{ end }} class="{{ if $current }}active{{ end }}">
34+
<a {{ if .Page.Content }}href="{{ .Page.RelPermalink }}"{{ else }}role="button"{{ end }} class="{{ if $current }}active{{ end }}">
3535
{{- partial "docs/title" .Page -}}
3636
</a>
3737
</label>
3838
{{ else if .Page.Content }}
39-
<a href="{{ .Page.Permalink }}" class="{{ if $current }} active{{ end }}">
39+
<a href="{{ .Page.RelPermalink }}" class="{{ if $current }} active{{ end }}">
4040
{{- partial "docs/title" .Page -}}
4141
</a>
4242
{{ else }}

0 commit comments

Comments
 (0)