forked from drowl87/hextra_mirror

* 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
28 lines
638 B
HTML
28 lines
638 B
HTML
{{/* 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 }}
|