diff options
author | Jimmy Cai <github@jimmycai.com> | 2022-03-06 12:58:02 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-03-06 12:58:02 +0300 |
commit | 07e1b856b02abcb544afefc425e464a2fa9e9d03 (patch) | |
tree | 9aa1268860093baf18291d2ca03ebed02b61ed9f | |
parent | 8f5164b5b90c0a83f58b98c5d04355401e312cbe (diff) |
feat: same container width on all pages (#534)
-rw-r--r-- | layouts/_default/baseof.html | 9 |
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" . }} |