Skip to content

Commit

Permalink
if translations absent, cache js bundle #101
Browse files Browse the repository at this point in the history
Signed-off-by: weru <fromweru@gmail.com>
  • Loading branch information
onweru committed Feb 21, 2023
1 parent 1faabb6 commit 7e4b5c8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions layouts/_default/baseof.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
{{ $config := site.Params }}
{{ $context := . }}
<!doctype html>
<html lang="{{ site.Language.Lang }}"{{ with site.Params.enableDarkMode }} class="dark"{{ end }}>
<html lang="{{ site.Language.Lang }}"{{ with $config.enableDarkMode }} class="dark"{{ end }}{{ with $config.defaultLightingMode }}
data-mode="{{ . }}"
{{ end }}>
<head>
{{- partial "head" . }}
</head>
Expand Down Expand Up @@ -34,7 +38,11 @@
{{ end }}
{{- partialCached "footer" . -}}
{{- partialCached "sprites" . -}}
{{- partialCached "scripts/bundle" . -}}
{{- with .Translations }}
{{- partial "scripts/bundle" $context -}}
{{- else }}
{{- partialCached "scripts/bundle" . -}}
{{- end }}
{{- partial "scripts/other" . -}}
</body>
</html>

0 comments on commit 7e4b5c8

Please sign in to comment.