Remove unneeded portable link trim

This commit is contained in:
Piotr Płaczek 2025-07-14 11:57:03 +01:00 committed by GitHub
parent f2c703e155
commit d7e76d58fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -10,10 +10,7 @@
{{- $isFragment := strings.HasPrefix .Destination "#" }} {{- $isFragment := strings.HasPrefix .Destination "#" }}
{{- if and (not $isRemote) (not $isFragment) }} {{- if and (not $isRemote) (not $isFragment) }}
{{- $url := urls.Parse .Destination }} {{- $url := urls.Parse .Destination }}
{{- $path := strings.TrimSuffix "/_index.md" $url.Path }} {{- $page := .Page.GetPage $url.Path }}
{{- $path = strings.TrimSuffix "/_index" $path }}
{{- $path = strings.TrimSuffix ".md" $path }}
{{- $page := .Page.GetPage $path }}
{{- if $page }} {{- if $page }}
{{- $destination = $page.RelPermalink }} {{- $destination = $page.RelPermalink }}
{{- if $url.Fragment }} {{- if $url.Fragment }}