From 575cc0ca8c4e5904c7ae77e76db812c52e5f8ed1 Mon Sep 17 00:00:00 2001
From: Aditya Telange <21258296+adityatelange@users.noreply.github.com>
Date: Sun, 27 Mar 2022 18:44:06 +0530
Subject: Use `site` function instead of `.Site` or `$.Site`
- The site function provides global access to the same data as the .Site page method.
- Current context (`.`) is never considered.
---
layouts/partials/header.html | 30 +++++++++++++++---------------
1 file changed, 15 insertions(+), 15 deletions(-)
(limited to 'layouts/partials/header.html')
diff --git a/layouts/partials/header.html b/layouts/partials/header.html
index f95a7a6..ff674c5 100644
--- a/layouts/partials/header.html
+++ b/layouts/partials/header.html
@@ -1,7 +1,7 @@
{{- /* theme-toggle is enabled */}}
-{{- if (not .Site.Params.disableThemeToggle) }}
+{{- if (not site.Params.disableThemeToggle) }}
{{- /* theme is light */}}
-{{- if (eq .Site.Params.defaultTheme "light") }}
+{{- if (eq site.Params.defaultTheme "light") }}
{{- /* theme is dark */}}
-{{- else if (eq .Site.Params.defaultTheme "dark") }}
+{{- else if (eq site.Params.defaultTheme "dark") }}
{{- end }}
{{- /* theme-toggle is disabled and theme is auto */}}
-{{- else if (and (ne .Site.Params.defaultTheme "light") (ne .Site.Params.defaultTheme "dark"))}}
+{{- else if (and (ne site.Params.defaultTheme "light") (ne site.Params.defaultTheme "dark"))}}