Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/CaiJimmy/hugo-theme-stack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJimmy Cai <github@jimmycai.com>2022-03-06 12:58:02 +0300
committerGitHub <noreply@github.com>2022-03-06 12:58:02 +0300
commit07e1b856b02abcb544afefc425e464a2fa9e9d03 (patch)
tree9aa1268860093baf18291d2ca03ebed02b61ed9f
parent8f5164b5b90c0a83f58b98c5d04355401e312cbe (diff)
feat: same container width on all pages (#534)
-rw-r--r--layouts/_default/baseof.html9
1 files changed, 8 insertions, 1 deletions
diff --git a/layouts/_default/baseof.html b/layouts/_default/baseof.html
index 98cc815..081277b 100644
--- a/layouts/_default/baseof.html
+++ b/layouts/_default/baseof.html
@@ -6,7 +6,14 @@
</head>
<body class="{{ block `body-class` . }}{{ end }}">
{{- partial "head/colorScheme" . -}}
- {{- $hasWidget := default (gt (len .Site.Params.widgets.homepage) 0) (.Scratch.Get "hasWidget") -}}
+
+ {{/* The container is wider when there's any activated widget */}}
+ {{- $hasWidget := false -}}
+ {{- range .Site.Params.widgets -}}
+ {{- if gt (len .) 0 -}}
+ {{- $hasWidget = true -}}
+ {{- end -}}
+ {{- end -}}
<div class="container main-container flex on-phone--column {{ if $hasWidget }}extended{{ else }}compact{{ end }}">
{{- block "left-sidebar" . -}}
{{ partial "sidebar/left.html" . }}