WIP body-module and smarter usage of container divs

This commit is contained in:
2025-08-19 13:40:51 -05:00
parent 741b3bc01b
commit 00a0f64be4
6 changed files with 126 additions and 110 deletions

View File

@@ -293,17 +293,35 @@ body {
color: var(--text-0); color: var(--text-0);
overflow-wrap: break-word; overflow-wrap: break-word;
margin: 0; margin: 0;
display: flex;
flex-direction: column;
align-items: center;
gap: var(--page-margin);
} }
.main-container { .body-module {
margin: var(--page-margin) auto; width: 100%; /* without, it collapses inside flexbox for some reason TODO: figure out why */
/* use padding because otherwise there's no way to have margin be both auto, and a minimum value */ }
padding: 0 var(--page-margin);
max-width: calc(720px + 2 * var(--page-margin)); /* padding is included in the element's width */ .body-module--marginless {
margin: 0;
}
.body-module--full-width {
margin: 0 var(--page-margin);
/*
margin-left: var(--page-margin);
margin-right: var(--page-margin);
*/
}
.body-module--wide {
margin-left: var(--page-margin);
margin-right: var(--page-margin);
max-width: 720px;
} }
footer { footer {
margin: var(--page-margin) 0; margin-bottom: var(--page-margin);
text-align: center; text-align: center;
font-size: smaller; font-size: smaller;
} }
@@ -376,10 +394,6 @@ footer p {
/* Breadcrumb navigation {{{ */ /* Breadcrumb navigation {{{ */
.breadcrumb {
margin: var(--page-margin) 0;
}
.breadcrumb ul { .breadcrumb ul {
margin: 0; margin: 0;
padding: 0; padding: 0;

View File

@@ -1,4 +1,4 @@
<nav class="breadcrumb" aria-label="{{ i18n "aria_breadcrumbnav" }}"> <nav class="body-module body-module--wide breadcrumb" aria-label="{{ i18n "aria_breadcrumbnav" }}">
<ul> <ul>
{{ template "breadcrumbnav" (dict "p1" . "p2" .) }} {{ template "breadcrumbnav" (dict "p1" . "p2" .) }}
</ul> </ul>

View File

@@ -1,4 +1,4 @@
<header class="top"> <header class="body-module body-module--marginless top">
<div class="brand"> <div class="brand">
<a href="{{ .Site.Home.Permalink | absLangURL }}"> <a href="{{ .Site.Home.Permalink | absLangURL }}">
{{ .Site.Title | markdownify }} {{ .Site.Title | markdownify }}

View File

@@ -8,11 +8,12 @@
{{ partial "top.html" . }} {{ partial "top.html" . }}
<div class="main-container">
{{ if not .IsHome }} {{ if not .IsHome }}
{{ partial "breadcrumb.html" . }} {{ partial "breadcrumb.html" . }}
{{ end }} {{ end }}
{{ block "pre-body" . }}{{ end }}
<main id="main-content"> <main id="main-content">
{{ block "main" . }} {{ block "main" . }}
THIS TEXT SHOULD NOT SHOW. YUZSIQGHE (that string is so I can grep for it) THIS TEXT SHOULD NOT SHOW. YUZSIQGHE (that string is so I can grep for it)
@@ -20,7 +21,7 @@
</main> </main>
{{ if or .Site.Copyright .Site.Params.footer }} {{ if or .Site.Copyright .Site.Params.footer }}
<footer> <footer class="body-module body-module--wide">
{{ with .Site.Copyright }} {{ with .Site.Copyright }}
{{ . | safeHTML }} {{ . | safeHTML }}
{{ end }} {{ end }}
@@ -30,7 +31,6 @@
{{ end }} {{ end }}
</footer> </footer>
{{ end }} {{ end }}
</div>
{{ block "post-body" . }} {{ block "post-body" . }}
{{/* currently this is only used for related posts */}} {{/* currently this is only used for related posts */}}

View File

@@ -1,13 +1,13 @@
{{ define "main" }} {{ define "main" }}
{{ with .Content }} {{ with .Content }}
<article class="homepage-content"> <article class="body-module body-module--wide">
{{ . }} {{ . }}
</article> </article>
<hr> <hr class="body-module body-module--wide">
{{ end }} {{ end }}
{{ if .Site.Params.homepageLatestPosts }} {{ if .Site.Params.homepageLatestPosts }}
<div class="homepage-latest-posts"> <div class="body-module body-module--wide">
<h1> <h1>
{{ i18n "latest_posts" }} {{ i18n "latest_posts" }}
{{ partial "rss-link.html" . }} {{ partial "rss-link.html" . }}

View File

@@ -1,4 +1,5 @@
{{ define "main" }} {{ define "main" }}
<article class="body-module body-module--wide">
<div class="page-title"> <div class="page-title">
<h1> <h1>
{{ .Title | markdownify }} {{ .Title | markdownify }}
@@ -81,4 +82,5 @@
{{ partial "page-list.html" . }} {{ partial "page-list.html" . }}
</div> </div>
{{ end }} {{ end }}
</article>
{{ end }} {{ end }}