Improve link render hook performance

This commit is contained in:
Joe Mooring
2025-01-29 12:58:33 -08:00
committed by GitHub
parent 23aeb5bd01
commit fd4508645f
+3 -3
View File
@@ -116,7 +116,7 @@ either of these shortcodes in conjunction with this render hook.
"renderHookName" $renderHookName
"text" .Text
}}
{{- $attrs = partial "inline/h-rh-l/get-glossary-link-attributes.html" $ctx }}
{{- $attrs = partialCached "inline/h-rh-l/get-glossary-link-attributes.html" $ctx }}
{{- else if $u.IsAbs }}
{{- /* Destination is a remote resource. */}}
{{- $attrs = merge $attrs (dict "rel" "external") }}
@@ -136,7 +136,7 @@ either of these shortcodes in conjunction with this render hook.
"parsedURL" $u
"renderHookName" $renderHookName
}}
{{- partial "inline/h-rh-l/validate-fragment.html" $ctx }}
{{- partialCached "inline/h-rh-l/validate-fragment.html" $ctx }}
{{- $href = printf "%s#%s" $href . }}
{{- end }}
{{- $attrs = dict "href" $href }}
@@ -169,7 +169,7 @@ either of these shortcodes in conjunction with this render hook.
"parsedURL" $u
"renderHookName" $renderHookName
}}
{{- partial "inline/h-rh-l/validate-fragment.html" $ctx }}
{{- partialCached "inline/h-rh-l/validate-fragment.html" $ctx }}
{{- $attrs = dict "href" (printf "%s#%s" $.Page.RelPermalink .) }}
{{- else }}
{{- if eq $errorLevel "warning" }}