theme: cache page-meta.hugo #380

This commit is contained in:
Sören Weber 2022-11-11 13:43:23 +01:00
parent 31173665d9
commit b1866d62df
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
8 changed files with 7 additions and 8 deletions

View file

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

View file

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

View file

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

View file

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

View file

@ -1,4 +1,4 @@
{{- partial "page-meta.hugo" . }}
{{- partialCached "page-meta.hugo" . . }}
{{- 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">
{{- range .Data.Pages }}

View file

@ -1,4 +1,4 @@
{{- partial "page-meta.hugo" . }}
{{- partialCached "page-meta.hugo" . . }}
{{- partial "output-partial.hugo" (dict "base" "header" "page" . "parameter" .) }}
{{- if not .File }}
{{- partial "output-partial.hugo" (dict "base" "body" "page" . "parameter" (dict "page" . "content" (partial "output-partial.hugo" (dict "base" "initial" "page" . "parameter" .)))) }}

View file

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

View file

@ -5,7 +5,6 @@
{{- $currentNode.Scratch.Delete "relearnIsHiddenNode" }}{{/* the node itself is flagged as hidden */}}
{{- $currentNode.Scratch.Delete "relearnIsHiddenStem" }}{{/* the node or one of its parents is flagged as hidden */}}
{{- $currentNode.Scratch.Delete "relearnIsHiddenFrom" }}{{/* the node is hidden from the current page */}}
{{- $currentNode.Scratch.Delete (printf "%sWantsMathJax" (partial "output-format.hugo" $currentNode)) }}
{{- $wantsMathjax := or (and (ne $currentNode.Params.disableMathjax nil) (not $currentNode.Params.disableMathjax)) (and (ne .Site.Params.disableMathjax nil) (not .Site.Params.disableMathjax)) }}
{{- if $wantsMathjax }}
{{- $currentNode.Store.Set "hasMathJax" true }}