2 Commits

Author SHA1 Message Date
314b533698 WIP 2025-08-22 19:51:15 -05:00
00a0f64be4 WIP body-module and smarter usage of container divs 2025-08-22 12:11:24 -05:00
6 changed files with 115 additions and 102 deletions

View File

@@ -295,15 +295,28 @@ body {
margin: 0; margin: 0;
} }
.main-container { .body-module {
margin: var(--page-margin) auto; }
/* use padding because otherwise there's no way to have margin be both auto, and a minimum value */
padding: 0 var(--page-margin); .body-module--marginless {
max-width: calc(720px + 2 * var(--page-margin)); /* padding is included in the element's width */ 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 +389,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,19 +8,24 @@
{{ 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)
{{ end }} {{ end }}
</main> </main>
{{ block "post-body" . }}
{{/* currently this is only used for related posts */}}
{{ end }}
{{ 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,11 +35,6 @@
{{ end }} {{ end }}
</footer> </footer>
{{ end }} {{ end }}
</div>
{{ block "post-body" . }}
{{/* currently this is only used for related posts */}}
{{ end }}
</body> </body>
</html> </html>

View File

@@ -1,13 +1,15 @@
{{ 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 }}
{{ end }}
{{ define "post-body" }}
{{ 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 }}
@@ -69,13 +70,14 @@
{{ partial "comments.html" . }} {{ partial "comments.html" . }}
</div> </div>
{{ end }} {{ end }}
</article>
{{ end }} {{ end }}
{{ define "post-body" }} {{ define "post-body" }}
{{ $related := .Site.RegularPages.Related . | first 10 }} {{ $related := .Site.RegularPages.Related . | first 10 }}
{{ with $related }} {{ with $related }}
<div class="related-posts"> <div class="related-posts body-module body-module--full-width">
<hr> <hr>
<h1>{{ i18n "related_posts" }}</h1> <h1>{{ i18n "related_posts" }}</h1>
{{ partial "page-list.html" . }} {{ partial "page-list.html" . }}