Menu: Allow to explicitly override if a menu url is remote or not (#809)

* Menu: Allow to explicitly override if a menu url is remote or not

This can be very useful if a hugo website f.e. on GitHub pages is
constructed from different individual spec repos but still represent
one coherent site.

* Rename param to bookNewTab

---------

Co-authored-by: Alex Shpak <alex-shpak@users.noreply.github.com>
This commit is contained in:
Levente Polyak
2026-05-10 23:33:57 +02:00
committed by GitHub
parent 517600c158
commit 4018d4b51d
+1 -1
View File
@@ -17,7 +17,7 @@
{{- $class = $class | append "active" -}}
{{- end -}}
<li>
{{- $isRemote := (urls.Parse .URL).IsAbs -}}
{{- $isRemote := default (urls.Parse .URL).IsAbs .Params.bookNewTab -}}
<a href="{{ .URL }}"
{{- with $class }} class="{{ delimit . " " }}"{{- end -}}
{{- with .Title }} title="{{ . }}"{{- end -}}