theme: only use RelPermalink for caching #380

because achretypes caching was unreliable when the whole page was used;
Hugo bug or is it just me?
This commit is contained in:
Sören Weber 2022-11-13 11:33:32 +01:00
parent 92919ac893
commit d2d7d808a0
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
9 changed files with 9 additions and 9 deletions

View file

@ -1,5 +1,5 @@
<!DOCTYPE html> <!DOCTYPE html>
{{- partialCached "page-meta.hugo" . . }} {{- partialCached "page-meta.hugo" . .RelPermalink }}
{{- $outputFormat := partial "output-format.hugo" . }} {{- $outputFormat := partial "output-format.hugo" . }}
<html lang="{{ .Page.Language | default "en" }}" dir="{{ T "Reading-direction" | default "ltr" }}"> <html lang="{{ .Page.Language | default "en" }}" dir="{{ T "Reading-direction" | default "ltr" }}">
<head> <head>

View file

@ -1,4 +1,4 @@
{{- partialCached "page-meta.hugo" . . }} {{- partialCached "page-meta.hugo" . .RelPermalink }}
{{- $pages := slice }} {{- $pages := slice }}
{{- range .Site.Pages }} {{- range .Site.Pages }}
{{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSearchHiddenPages true) ) }} {{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSearchHiddenPages true) ) }}

View file

@ -1,4 +1,4 @@
{{- partialCached "page-meta.hugo" . . }} {{- partialCached "page-meta.hugo" . .RelPermalink }}
{{- $pages := slice }} {{- $pages := slice }}
{{- range .Site.Pages }} {{- range .Site.Pages }}
{{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSearchHiddenPages true) ) }} {{- if and .Title (or (ne (.Scratch.Get "relearnIsHiddenStem") true) (ne .Site.Params.disableSearchHiddenPages true) ) }}

View file

@ -1,4 +1,4 @@
{{- partialCached "page-meta.hugo" . . }} {{- partialCached "page-meta.hugo" . .RelPermalink }}
{{- $pages := .Page.Pages }} {{- $pages := .Page.Pages }}
{{- if .Page.IsHome }} {{- if .Page.IsHome }}
{{- $pages = .Page.Sections }} {{- $pages = .Page.Sections }}

View file

@ -1,4 +1,4 @@
{{- partialCached "page-meta.hugo" . . }} {{- partialCached "page-meta.hugo" . .RelPermalink }}
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }} {{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\" ?>" | safeHTML }}
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml"> <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">
{{- range .Data.Pages }} {{- range .Data.Pages }}

View file

@ -1,4 +1,4 @@
{{- partialCached "page-meta.hugo" . . }} {{- partialCached "page-meta.hugo" . .RelPermalink }}
{{- $outputFormat := partial "output-format.hugo" . }} {{- $outputFormat := partial "output-format.hugo" . }}
{{- partial "output-partial.hugo" (dict "base" "header" "page" . "parameter" . "outputFormat" $outputFormat) }} {{- partial "output-partial.hugo" (dict "base" "header" "page" . "parameter" . "outputFormat" $outputFormat) }}
{{- if not .File }} {{- if not .File }}

View file

@ -1,4 +1,4 @@
{{- partialCached "page-meta.hugo" . . }} {{- partialCached "page-meta.hugo" . .RelPermalink }}
{{- partial "header.html" . }} {{- partial "header.html" . }}
<article> <article>
{{- $page := . }} {{- $page := . }}

View file

@ -2,7 +2,7 @@
</main><!-- #body-inner --> </main><!-- #body-inner -->
{{- partial "custom-comments.html" . }} {{- partial "custom-comments.html" . }}
</div><!-- #body --> </div><!-- #body -->
{{- partialCached "menu.html" . . }} {{- partialCached "menu.html" . .RelPermalink }}
<script src="{{"js/clipboard.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script> <script src="{{"js/clipboard.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
<script src="{{"js/perfect-scrollbar.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script> <script src="{{"js/perfect-scrollbar.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>
<script src="{{"js/featherlight.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script> <script src="{{"js/featherlight.min.js" | relURL}}{{ if not .Site.Params.disableAssetsBusting }}?{{ now.Unix }}{{ end }}" defer></script>

View file

@ -5,7 +5,7 @@
{{- if not $outputFormat }} {{- if not $outputFormat }}
{{- $outputFormat = partial "output-format.hugo" $page }} {{- $outputFormat = partial "output-format.hugo" $page }}
{{- end }} {{- end }}
{{- $suffix := partialCached "output-suffix.hugo" $page $page $outputFormat }} {{- $suffix := partialCached "output-suffix.hugo" $page $page.RelPermalink $outputFormat }}
{{- $f := printf "/layouts/partials/%s.%s.%s" $base $outputFormat $suffix }} {{- $f := printf "/layouts/partials/%s.%s.%s" $base $outputFormat $suffix }}
{{- if or (not $outputFormat) (not (partialCached "fileExists.hugo" $f $f)) }} {{- if or (not $outputFormat) (not (partialCached "fileExists.hugo" $f $f)) }}
{{- $f = printf "/layouts/partials/%s.%s" $base $suffix }} {{- $f = printf "/layouts/partials/%s.%s" $base $suffix }}