link: check fragments on same page #1060
Some checks are pending
docs-build-deployment / Run deploy (push) Waiting to run
docs-build / Run build (push) Waiting to run

This commit is contained in:
Sören Weber 2025-03-16 23:59:39 +01:00
parent b89d1e3fb6
commit bc0011fc05
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
2 changed files with 8 additions and 2 deletions

View file

@ -1,7 +1,13 @@
{{- $u := urls.Parse .url }} {{- $u := urls.Parse .url }}
{{- $hideFilepath := .hideFilepath | default false }} {{- $hideFilepath := .hideFilepath | default false }}
{{- $type := printf "%T" .linkObject }} {{- $type := printf "%T" .linkObject }}
{{- $isPage := eq $type "*hugolib.pageState" }} {{- $isPage := or
(eq $type "*hugolib.pageForRenderHooks")
(eq $type "*hugolib.pageForShortcode")
(eq $type "*hugolib.pageState")
(eq $type "*hugolib.pageWithOrdinal")
(eq $type "*hugolib.pageWithWeight0")
}}
{{- $href := partial "permalink.gotmpl" (dict "to" .linkObject) }} {{- $href := partial "permalink.gotmpl" (dict "to" .linkObject) }}
{{- if $isPage }} {{- if $isPage }}
{{- $format := $u.Query.Get "format" }} {{- $format := $u.Query.Get "format" }}

View file

@ -1 +1 @@
7.5.0+566c17d000a04bc3d189525bfb8d2ea06dcfe71d 7.5.0+b89d1e3fb63c72c28f83bda3ef08bdca7723066c