hugo: use partialCached for static templates

Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
This commit is contained in:
David Karlsson
2026-03-17 08:44:59 +01:00
parent 0eb47623bc
commit c3d814812f
5 changed files with 6 additions and 6 deletions

View File

@@ -2,7 +2,7 @@
<div class="flex items-start justify-between">
<h1 data-pagefind-weight="10">{{ .Title | safeHTML }}</h1>
<div class="md-dropdown ml-auto hidden lg:block">
{{ partial "md-dropdown.html" . }}
{{ partialCached "md-dropdown.html" "-" "-" }}
</div>
</div>
<div class="block lg:hidden">

View File

@@ -4,7 +4,7 @@
{{- range .AlternativeOutputFormats -}}
<link rel="{{ .Rel }}" type="{{ .MediaType.Type }}" href="{{ .Permalink }}" />
{{ end -}}
{{ partial "utils/css.html" "-" }}
{{ partialCached "utils/css.html" "-" "-" }}
<link href="/pagefind/pagefind-component-ui.css" rel="stylesheet">
{{- if hugo.IsProduction -}}
<script

View File

@@ -7,10 +7,10 @@
class="bg-white dark:bg-gray-800 hover:bg-gray-50 dark:hover:bg-gray-700 flex cursor-pointer items-center gap-2 px-3 py-2 text-sm transition-colors whitespace-nowrap text-gray-900 dark:text-white"
>
<span class="icon-svg icon-sm">
{{ partial "icon" "content_copy" }}
{{ partialCached "icon" "content_copy" "content_copy" }}
</span>
<span class="icon-svg icon-sm hidden">
{{ partial "icon" "check_circle" }}
{{ partialCached "icon" "check_circle" "check_circle" }}
</span>
<span>Copy as Markdown</span>
</button>

View File

@@ -93,7 +93,7 @@
{{/* Load the YouTube player if the page embeds a YouTube video */}}
{{ with .Store.Get "youtube" }}
{{ partial "youtube-script.html" . }}
{{ partialCached "youtube-script.html" "-" "-" }}
{{ end }}
</body>
</html>

View File

@@ -8,7 +8,7 @@
<div class="flex items-start justify-between gap-4">
<h1>{{ .Title }}</h1>
<div class="md-dropdown ml-auto mr-4 hidden lg:block">
{{ partial "md-dropdown.html" . }}
{{ partialCached "md-dropdown.html" "-" "-" }}
</div>
</div>
<div class="overflow-x-auto">