variant: cache variant config #679

This commit is contained in:
Sören Weber 2023-11-26 18:11:56 +01:00
parent ff978f3be1
commit 1119b3f9a6
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
2 changed files with 2 additions and 2 deletions

View file

@ -58,7 +58,7 @@
{{- end }}
{{- $siteLanguages := .Site.Languages }}
{{- $showlangswitch := and .Site.IsMultiLingual (not .Site.Params.disableLanguageSwitchingButton) (gt (int (len $siteLanguages)) 1) }}
{{- $themevariants := partial "get-theme-variants.hugo" . }}
{{- $themevariants := partialCached "get-theme-variants.hugo" . }}
{{- $showvariantswitch := gt (int (len $themevariants)) 1 }}
{{- $footer := partial "menu-footer.html" . }}
{{- $showfooter := not (eq 0 (int (len ($footer | plainify)))) }}

View file

@ -13,7 +13,7 @@
<link href="{{"css/perfect-scrollbar.min.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
<link href="{{"css/fonts.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet" media="print" onload="this.media='all';this.onload=null;"><noscript><link href="{{"css/fonts.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet"></noscript>
<link href="{{"css/theme.css" | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet">
{{- $themevariants := partial "get-theme-variants.hugo" . }}
{{- $themevariants := partialCached "get-theme-variants.hugo" . }}
{{- with index $themevariants 0 }}
<link href="{{(printf "css/chroma-%s.css" .chroma) | safeHTML | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet" id="R-variant-chroma-style">
<link href="{{(printf "css/theme-%s.css" .identifier) | relURL}}{{ if $assetBusting }}?{{ now.Unix }}{{ end }}" rel="stylesheet" id="R-variant-style">