1 Commits

Author SHA1 Message Date
f35a286d34 WIP body-module and smarter usage of container divs 2025-08-19 13:40:51 -05:00
8 changed files with 60 additions and 68 deletions

View File

@@ -293,33 +293,31 @@ body {
color: var(--text-0);
overflow-wrap: break-word;
margin: 0;
display: flex;
flex-direction: column;
align-items: center;
gap: var(--page-margin);
}
/* body-module types:
*
* full-width: no max-width, no margin from the sides of the page
* full-padded: no max-width, but has margin from the left/right page edges
* center: max-width 720px, centered when too large, padded when screen is narrow
*/
.body-module {
width: 100%; /* without, it collapses inside flexbox for some reason TODO: figure out why */
}
.body-module--full-width,
.body-module--full-padded,
.body-module--center-wide {
margin-block: var(--page-margin);
.body-module--marginless {
margin: 0;
}
.body-module--full-width {
margin-inline: 0;
margin: 0 var(--page-margin);
/*
margin-left: var(--page-margin);
margin-right: var(--page-margin);
*/
}
.body-module-full-padded {
margin-inline: var(--page-margin);
}
.body-module--center {
margin-inline: auto;
/* add the minimum margin here because we are using auto for its centering */
padding-inline: var(--page-margin);
/* account for the padding being included in the element's calculated width */
max-width: calc(720px + 2 * var(--page-margin));
.body-module--wide {
margin-left: var(--page-margin);
margin-right: var(--page-margin);
max-width: 720px;
}
footer {

View File

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

View File

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

View File

@@ -1,26 +1,24 @@
{{ define "main" }}
<section class="body-module--center">
<h1>
{{ partial "icon.html" "user-circle" }}
{{ .Title | markdownify }}
</h1>
<h1>
{{ partial "icon.html" "user-circle" }}
{{ .Title | markdownify }}
</h1>
{{ with .Content }}
{{ . }}
{{ end }}
{{ with .Content }}
{{ . }}
{{ end }}
<div class="page-list">
{{ with .Paginator.Pages }}
{{ range . }}
<article class="page">
{{ .Render "summary" }}
</article>
{{ end }}
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
<div class="page-list">
{{ with .Paginator.Pages }}
{{ range . }}
<article class="page">
{{ .Render "summary" }}
</article>
{{ end }}
</div>
</section>
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</div>
{{ end }}

View File

@@ -20,10 +20,8 @@
{{ end }}
</main>
{{ block "post-body" . }}{{ end }}
{{ if or .Site.Copyright .Site.Params.footer }}
<footer class="body-module--center">
<footer class="body-module body-module--wide">
{{ with .Site.Copyright }}
{{ . | safeHTML }}
{{ end }}
@@ -33,6 +31,10 @@
{{ end }}
</footer>
{{ end }}
{{ block "post-body" . }}
{{/* currently this is only used for related posts */}}
{{ end }}
</body>
</html>

View File

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

View File

@@ -1,5 +1,5 @@
{{ define "main" }}
<article class="body-module--center">
<article class="body-module body-module--wide">
<div class="page-title">
<h1>
{{ .Title | markdownify }}
@@ -70,17 +70,17 @@
{{ partial "comments.html" . }}
</div>
{{ end }}
{{ end }}
{{ define "post-body" }}
{{ $related := .Site.RegularPages.Related . | first 10 }}
{{ with $related }}
<div class="related-posts">
<hr>
<h1>{{ i18n "related_posts" }}</h1>
{{ partial "page-list.html" . }}
</div>
{{ end }}
</article>
{{ end }}
{{ define "post-body" }}
{{ $related := .Site.RegularPages.Related . | first 10 }}
{{ with $related }}
<div class="body-module--full-width related-posts">
<hr>
<h1>{{ i18n "related_posts" }}</h1>
{{ partial "page-list.html" . }}
</div>
{{ end }}
{{ end }}

View File

@@ -1,6 +1,2 @@
User-Agent: *
Sitemap: {{ "sitemap.xml" | absLangURL }}
{{/* It complains about the raw markdown output having no title tag */ -}}
User-Agent: Bingbot
Disallow: /blog/*.md$