fix: cache page title partial

This commit is contained in:
Ben Goldsworthy 2025-04-15 13:10:38 +02:00
parent eb4b646711
commit bfa512eb6f
No known key found for this signature in database
2 changed files with 10 additions and 2 deletions

View file

@ -86,7 +86,11 @@
</span>
{{ end }}
{{- partial "text/item-title.html" ( dict "pc" . "sc" $ "class" "item-tile" ) -}}
{{- if .File -}}
{{- partialCached "text/item-title.html" ( dict "pc" . "sc" $ "class" "item-tile" ) .File.Filename -}}
{{- else -}}
{{- partial "text/item-title.html" ( dict "pc" . "sc" $ "class" "item-tile" ) -}}
{{- end -}}
<p style="display: none;">

View file

@ -40,7 +40,11 @@
<div class="article-header__title-wrapper">
<a class="u-url u-uid" style="display: none" href="{{ .pc.Permalink }}"></a>
{{- partialCached "text/item-title.html" ( dict "pc" .pc "sc" .sc "class" "article-header" ) .File.Filename -}}
{{- with .pc.File -}}
{{- partialCached "text/item-title.html" ( dict "pc" $.pc "sc" $.sc "class" "article-header" ) .Filename -}}
{{- else -}}
{{- partial "text/item-title.html" ( dict "pc" $.pc "sc" $.sc "class" "article-header" ) -}}
{{- end -}}
</div>
{{ with ( .pc.Resources.GetMatch .pc.Params.featured_image ) }}