allow customize post page width

This commit is contained in:
Reorx 2022-04-09 23:31:15 +08:00
parent c5d31c778b
commit 8c5d10925e
3 changed files with 8 additions and 2 deletions

View File

@ -1,3 +1,4 @@
/* for home and other pages */
.main { .main {
position: relative; position: relative;
min-height: calc(100vh - var(--header-height) - var(--footer-height)); min-height: calc(100vh - var(--header-height) - var(--footer-height));
@ -5,6 +6,10 @@
margin: auto; margin: auto;
padding: var(--gap); padding: var(--gap);
} }
/* for post page */
.main.post {
max-width: calc(var(--post-width) + var(--gap) * 2);
}
.page-header h1 { .page-header h1 {
font-size: 40px; font-size: 40px;

View File

@ -1,8 +1,9 @@
:root { :root {
--gap: 24px; --gap: 24px;
--content-gap: 20px; --content-gap: 20px;
--nav-width: 1024px; --nav-width: 960px;
--main-width: 720px; --main-width: 720px;
--post-width: 800px;
--header-height: 60px; --header-height: 60px;
--footer-height: 60px; --footer-height: 60px;
--radius: 8px; --radius: 8px;

View File

@ -14,7 +14,7 @@
{{- end -}} {{- end -}}
" id="top"> " id="top">
{{- partialCached "header.html" . .Page -}} {{- partialCached "header.html" . .Page -}}
<main class="main"> <main class="main {{- if (eq .Kind `page`) -}}{{- print " post" -}}{{- end -}}">
{{- block "main" . }}{{ end }} {{- block "main" . }}{{ end }}
</main> </main>
{{ partialCached "footer.html" . .Layout .Kind (.Param "hideFooter") (.Param "ShowCodeCopyButtons") -}} {{ partialCached "footer.html" . .Layout .Kind (.Param "hideFooter") (.Param "ShowCodeCopyButtons") -}}