Skip to content
Snippets Groups Projects
Unverified Commit 98d19b8e authored by Giuseppe Masino's avatar Giuseppe Masino Committed by GitHub
Browse files

Make menu entries' link relative (#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.
parent 5581ec08
No related branches found
No related tags found
No related merge requests found
......@@ -31,12 +31,12 @@
{{ if .Page.Params.bookCollapseSection }}
<input type="checkbox" id="section-{{ md5 .Page }}" class="toggle" {{ if or $current $ancestor }}checked{{ end }} />
<label for="section-{{ md5 .Page }}" class="flex justify-between">
<a {{ if .Page.Content }}href="{{ .Page.Permalink }}"{{ else }}role="button"{{ end }} class="{{ if $current }}active{{ end }}">
<a {{ if .Page.Content }}href="{{ .Page.RelPermalink }}"{{ else }}role="button"{{ end }} class="{{ if $current }}active{{ end }}">
{{- partial "docs/title" .Page -}}
</a>
</label>
{{ else if .Page.Content }}
<a href="{{ .Page.Permalink }}" class="{{ if $current }} active{{ end }}">
<a href="{{ .Page.RelPermalink }}" class="{{ if $current }} active{{ end }}">
{{- partial "docs/title" .Page -}}
</a>
{{ else }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment