1 Commits

Author SHA1 Message Date
00a0f64be4 WIP body-module and smarter usage of container divs 2025-08-22 12:11:24 -05:00
13 changed files with 126 additions and 122 deletions

View File

@@ -293,22 +293,40 @@ body {
color: var(--text-0);
overflow-wrap: break-word;
margin: 0;
display: flex;
flex-direction: column;
align-items: center;
gap: var(--page-margin);
}
.main-container {
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);
max-width: calc(720px + 2 * var(--page-margin)); /* padding is included in the element's width */
.body-module {
width: 100%; /* without, it collapses inside flexbox for some reason TODO: figure out why */
}
.site-footer {
margin: var(--page-margin) 0;
.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 {
margin-bottom: var(--page-margin);
text-align: center;
font-size: smaller;
}
.site-footer p {
footer p {
margin: 0;
}
@@ -376,10 +394,6 @@ body {
/* Breadcrumb navigation {{{ */
.breadcrumb {
margin: var(--page-margin) 0;
}
.breadcrumb ul {
margin: 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>
{{ template "breadcrumbnav" (dict "p1" . "p2" .) }}
</ul>

View File

@@ -1,5 +1,5 @@
{{ if or .Date .Params.authors .Site.Params.readingtime .Site.Params.gitFileURL }}
<section class="page-metadata" aria-label="{{ i18n "aria_post_metadata" }}">
<div class="page-metadata" aria-label="{{ i18n "aria_post_metadata" }}">
{{ if .Date }}
<span class="page-metadata-item" aria-label="{{ i18n "aria_post_meta_date" }}">
{{ partial "icon.html" "calendar" }}
@@ -26,5 +26,5 @@
{{ partial "page-metadata/item/categories.html" . }}
{{ partial "page-metadata/item/tags.html" . }}
</section>
</div>
{{ end }}

View File

@@ -1,5 +1,5 @@
{{ if or .Date .Params.authors .Site.Params.readingtime }}
<section class="page-metadata" aria-label="{{ i18n "aria_post_metadata" }}">
<div class="page-metadata" aria-label="{{ i18n "aria_post_metadata" }}">
{{ if .Date }}
<span class="page-metadata-item" aria-label="date">
{{ partial "icon.html" "calendar" }}
@@ -14,5 +14,5 @@
{{ partial "page-metadata/item/series.html" . }}
{{ partial "page-metadata/item/categories.html" . }}
{{ partial "page-metadata/item/tags.html" . }}
</section>
</div>
{{ end }}

View File

@@ -1,4 +1,4 @@
<section class="share-buttons">
<div class="share-buttons">
{{ if .Site.Params.shareButtons.twitter }}
<a class="twitter-share"
target="_blank"
@@ -66,4 +66,4 @@
{{- partial "icon.html" "printer" -}}
</a>
{{ end }}
</section>
</div>

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 }}

24
layouts/authors/list.html Normal file
View File

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

View File

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

View File

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

View File

@@ -1,13 +1,13 @@
{{ define "main" }}
{{ with .Content }}
<article class="homepage-content">
<article class="body-module body-module--wide">
{{ . }}
</article>
<hr class="body-module body-module--wide">
{{ end }}
{{ if .Site.Params.homepageLatestPosts }}
<hr>
<section class="homepage-latest-posts">
<div class="body-module body-module--wide">
<h1>
{{ i18n "latest_posts" }}
{{ partial "rss-link.html" . }}
@@ -16,6 +16,6 @@
{{ partial "page-list.html" (.Paginate .Site.RegularPages).Pages }}
{{ partial "pagination.html" . }}
</section>
</div>
{{ end }}
{{ end }}

View File

@@ -1,5 +1,5 @@
{{ define "main" }}
<article>
<article class="body-module body-module--wide">
<div class="page-title">
<h1>
{{ .Title | markdownify }}
@@ -11,12 +11,12 @@
{{ partial "series-box.html" . }}
{{ if .Params.Toc }}
<section class="table-of-contents" aria-label="{{ i18n "aria_table_of_contents" }}">
<div class="table-of-contents" aria-label="{{ i18n "aria_table_of_contents" }}">
<details>
<summary>{{ i18n "table_of_contents" }}</summary>
{{ .TableOfContents }}
</details>
</section>
</div>
<div class="table-of-contents print">
{{ i18n "table_of_contents" }}
{{ .TableOfContents }}
@@ -25,14 +25,14 @@
{{ partial "feature-figure.html" . }}
<div class="post-content" data-pagefind-body>
<article class="post-content" data-pagefind-body>
{{ .Content }}
</div>
</article>
{{ partial "series-box.html" . }}
{{ if or .NextInSection .PrevInSection }}
<nav class="prevnext">
<div class="prevnext">
{{ with .NextInSection }}
<a class="prev" href="{{ .Permalink }}">
<div class="prev-caption">
@@ -58,7 +58,7 @@
{{ else }}
<div class="next"></div>
{{ end }}
</nav>
</div>
{{ end }}
{{ if .Site.Params.shareButtons }}
@@ -66,21 +66,21 @@
{{ end }}
{{ if .Params.comments }}
<section class="comments">
<div class="comments">
{{ partial "comments.html" . }}
</section>
</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="related-posts">
<hr>
<h1>{{ i18n "related_posts" }}</h1>
{{ partial "page-list.html" . }}
</div>
{{ end }}
{{ end }}

View File

@@ -1,27 +1,25 @@
{{ define "main" }}
<section>
<h1>
{{ with .Params.icon }}{{ partial "icon.html" . }}{{ end }}
{{ .Title | markdownify }}
{{ partial "rss-link.html" . }}
</h1>
<h1>
{{ with .Params.icon }}{{ partial "icon.html" . }}{{ end }}
{{ .Title | markdownify }}
{{ partial "rss-link.html" . }}
</h1>
{{ with .Content }}
{{ . }}
{{ with .Content }}
{{ . }}
{{ end }}
<div class="list-page-container">
{{ with .Sections }}
<div class="sections">
{{ range . }}
{{ .Render "summary" }}
{{ end }}
</div>
{{ end }}
<div class="list-page-container">
{{ with .Sections }}
<div class="sections">
{{ range . }}
{{ .Render "summary" }}
{{ end }}
</div>
{{ end }}
{{ partial "page-list.html" .Paginator.Pages }}
</div>
{{ partial "page-list.html" .Paginator.Pages }}
</div>
{{ partial "pagination.html" . }}
</section>
{{ partial "pagination.html" . }}
{{ end }}

View File

@@ -1,10 +1,8 @@
{{ define "main" }}
<div class="page-title">
<h1>
{{ partial "icon.html" "files" }}
{{ .Title | markdownify }}
</h1>
</div>
<h1>
{{ partial "icon.html" "files" }}
{{ .Title | markdownify }}
</h1>
{{ with .Content }}
{{ . }}