From 0d793587aa8b99327e1fe55c03b905ad54cc6992 Mon Sep 17 00:00:00 2001 From: Tony Wasserka Date: Fri, 27 Sep 2024 09:55:21 +0200 Subject: [PATCH] Ensure link checks are case sensitive --- layouts/_default/_markup/render-link.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/layouts/_default/_markup/render-link.html b/layouts/_default/_markup/render-link.html index 236b520c..b37f4bda 100644 --- a/layouts/_default/_markup/render-link.html +++ b/layouts/_default/_markup/render-link.html @@ -2,7 +2,14 @@ {{ $isExternal := (strings.HasPrefix .Destination "http") }} {{- if (not (or $isExternal (strings.HasPrefix .Destination "#"))) }} {{ $style := "" }} - {{ with $.PageInner.GetPage (index (strings.Split .Destination "#") 0) }} + {{ $desiredPage := (index (strings.Split .Destination "#") 0) }} + {{ with $.PageInner.GetPage $desiredPage }} + + {{ with .File }} + {{ if (ne .Path (print $desiredPage "." .Ext)) }} + {{ $style = "color:#ba0000" }} + {{ end }} + {{ end }} {{ else }} {{ $style = "color:#ba0000" }} {{ end }}