feat: support wide and full page modes (#69)

* feat: add page width config and partial

* feat: use page-width partial in layouts

* chore: revert changes in navbar and footer

* feat: customize footer width from site config

* chore: update styles

* docs: add page width

* feat: allow overriding navbar width

* fix: navbar width variable

* docs: add instruction for navbar and footer
This commit is contained in:
Xin
2023-09-20 23:36:00 +01:00
committed by GitHub
parent c799160e86
commit b51bfa3177
15 changed files with 87 additions and 13 deletions

View File

@ -0,0 +1,27 @@
{{/* Get page width from site configuration */}}
{{/* Default page width */}}
{{- $pageWidth := "" -}}
{{/* Get page width setting from page front matter or site params */}}
{{ with .Params.width -}}
{{ $pageWidth = . -}}
{{ else -}}
{{ with .Site.Params.page.width -}}
{{ $pageWidth = . -}}
{{ end -}}
{{ end -}}
{{- with $pageWidth -}}
{{ if eq . "wide" -}}
{{ $pageWidth = "max-w-[90rem]" -}}
{{ else if eq . "full" -}}
{{ $pageWidth = "max-w-full" -}}
{{ else -}}
{{ $pageWidth = "max-w-screen-xl" -}}
{{ end -}}
{{ else -}}
{{ $pageWidth = "max-w-screen-xl" -}}
{{ end -}}
{{ return $pageWidth }}