From 066c5ce8eb37a4d539565a64e1ccdb4afc7c4721 Mon Sep 17 00:00:00 2001 From: Mark Dumay <61946753+markdumay@users.noreply.github.com> Date: Fri, 25 Oct 2024 15:32:44 +0200 Subject: [PATCH 1/2] Fix cleaning of links that include a scheme --- layouts/partials/assets/link.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/assets/link.html b/layouts/partials/assets/link.html index d305a831..30b3b69c 100644 --- a/layouts/partials/assets/link.html +++ b/layouts/partials/assets/link.html @@ -18,10 +18,10 @@ {{ if not $u.Scheme }} {{ $b := urls.Parse site.BaseURL }} {{ $destination = strings.TrimPrefix $b.Path $destination }} + {{ $destination = path.Clean $destination }} {{ else }} {{ $destination = (strings.TrimPrefix (strings.TrimSuffix "/" site.BaseURL) $destination) }} {{ end }} -{{ $destination = path.Clean $destination }} {{ if not $destination }}{{ $destination = "/" }}{{ end }} {{- $target := "" -}} From 314f1a0ca408c3ee6494b1fc36b9ec5da09d2aae Mon Sep 17 00:00:00 2001 From: Mark Dumay <61946753+markdumay@users.noreply.github.com> Date: Fri, 25 Oct 2024 15:50:50 +0200 Subject: [PATCH 2/2] Fix navbar menu conditional check --- layouts/partials/assets/navbar-item.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layouts/partials/assets/navbar-item.html b/layouts/partials/assets/navbar-item.html index aa9882d8..926d0e7a 100644 --- a/layouts/partials/assets/navbar-item.html +++ b/layouts/partials/assets/navbar-item.html @@ -85,7 +85,7 @@ "size" "sm" )}} {{ else }} - {{ cond $menuURL " @@ -100,6 +100,6 @@ {{ if or (not $isIcon) $plain }}{{ $menu.Name }}{{ end }} {{- with $menu.Post }}{{ . }}{{ end -}} {{- if not $isIcon }} {{ $suffix }}{{ end -}} - {{ cond $menuURL "" "" | safeHTML }} + {{ cond (ne $menuURL "") "" "" | safeHTML }} {{ end }} {{ end }} \ No newline at end of file