Skip to content

Commit

Permalink
Ensure link checks are case sensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
neobrain committed Sep 27, 2024
1 parent 22b26c6 commit 9274660
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion layouts/_default/_markup/render-link.html
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
<!-- GetPage isn't case sensitive, so double-check the page name is spelled correctly -->
{{ with .File }}
{{ if (ne .Path (print $desiredPage "." .Ext)) }}
{{ $style = "color:#ba0000" }}
{{ end }}
{{ end }}
{{ else }}
{{ $style = "color:#ba0000" }}
{{ end }}
Expand Down

0 comments on commit 9274660

Please sign in to comment.