3 Commits

Author SHA1 Message Date
1f4a06569d WIP? add optional dict to page-list 2025-08-31 03:14:35 -05:00
5590019c74 WIP 2025-08-31 03:10:01 -05:00
90ead0daea WIP 2025-08-31 03:09:37 -05:00
10 changed files with 100 additions and 120 deletions

View File

@@ -174,6 +174,30 @@ video {
max-width: 100%;
}
figure > .figure-media {
padding: 5px;
}
figure > .figure-media.border {
border: 2px solid var(--figure-border);
}
.post-media > figure > .figure-media {
border: 7px solid var(--figure-border);
}
figure {
display: block;
text-align: center;
margin: 0;
}
figcaption {
font-style: italic;
font-size: small;
text-align: center;
}
a {
color: var(--link-0);
text-decoration: inherit;
@@ -420,26 +444,26 @@ body {
/* }}} */
/* Summary card formatting {{{ */
/* List layout {{{ */
.summary-card {
.page-list {
display: flex;
flex-direction: column;
list-style: none;
padding: 0;
gap: 40px;
margin-top: 16px;
}
.summary {
padding: 24px;
border-radius: 12px;
background-color: var(--background-1);
color: var(--text-1);
}
.summary-card-title {
.summary-title {
margin-top: 0;
margin-bottom: 10px;
}
.summary-card-title a {
color: inherit;
}
.summary-card-title h1 {
margin: 0;
}
/* hugo just can't handle this feature
@@ -450,6 +474,29 @@ body {
}
*/
.page-title,
.summary-title {
margin-bottom: 10px;
}
.page-title a,
.summary-title a {
color: inherit;
}
.page-title h1,
.summary-title h1 {
margin: 0;
}
.summary-description {
margin-top: 10px;
}
.summary-readmore {
margin-top: 5px;
}
.page-metadata {
margin-bottom: 24px;
}
@@ -471,71 +518,9 @@ body {
content: ",";
}
/* for formatting of the featured image/media, see the .featured-media class */
.summary-card-description {
margin-top: 10px;
}
.summary-card-readmore {
margin-top: 5px;
}
/* }}} */
/* Figures, and featured media component (used in page.html and summary-card) {{{ */
figure > .figure-media {
padding: 5px;
}
figure > .figure-media.border {
border: 2px solid var(--figure-border);
}
figure {
display: block;
text-align: center;
margin: 0;
}
figcaption {
font-style: italic;
font-size: small;
text-align: center;
}
.featured-media {
.post-media {
margin-top: 15px;
}
.featured-media > figure > .figure-media {
border: 7px solid var(--figure-border);
}
/* }}} */
/* List layout {{{ */
.page-list {
display: flex;
flex-direction: column;
list-style: none;
padding: 0;
gap: 40px;
margin-top: 16px;
}
.page-title {
margin-bottom: 10px;
}
.page-title a {
color: inherit;
}
.page-title h1 {
margin: 0;
}
/* }}} */
@@ -589,11 +574,7 @@ figcaption {
/* Series list layout {{{ */
.page-list--series {
gap: 80px;
}
.page-list--series-inner {
.page-list-series-inner {
gap: 10px;
flex-direction: row;
flex-flow: row wrap;
@@ -602,7 +583,7 @@ figcaption {
padding: 8px;
border-radius: 16px;
}
.page-list--series-inner > .summary-card {
.page-list-series-inner > .summary {
flex: 1;
min-width: 49%;
}
@@ -788,16 +769,16 @@ figcaption {
margin: var(--page-margin);
}
.related-posts .summary-card {
.related-posts .page {
min-width: 300px;
max-width: 300px;
}
.related-posts .summary-card:first-child {
.related-posts .page:first-child {
margin-left: var(--page-margin);
}
.related-posts .summary-card:last-child {
.related-posts .page:last-child {
margin-right: var(--page-margin);
}

View File

@@ -48,8 +48,6 @@ post_count:
# Navigation
read_more:
other: "Read more"
see_posts:
other: "See posts"
related_posts:
other: "Related Posts"

View File

@@ -1,5 +1,5 @@
{{ with .Resources.Get "feature" }}
<div class="featured-media">
<div class="post-media">
<figure>
{{ partial "embed-resource.html" . }}
{{ with .Title }}

View File

@@ -1,5 +1,16 @@
<div class="page-list">
{{ with . }}
{{ $list := dict }}
{{ $extraclasses := "" }}
{{ with try (index . "list") }}
{{ if .Err }}
{{ $list = $ }}
{{ else }}
{{ $list = .Value }}
{{ $extraclasses = index $ "classes" }}
{{ end }}
{{ end }}
<div class="page-list{{ with $extraclasses }}{{ . }}{{ end }}">
{{ with $list }}
{{ range . }}
{{ .Render "summary" }}
{{ end }}

View File

@@ -1,5 +1,5 @@
<article class="summary-card">
<h2 class="summary-card-title">
<article class="summary">
<h2 class="summary-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
</h2>
@@ -7,12 +7,12 @@
{{ partial "page-metadata/author.html" . }}
{{ with .Summary }}
<div class="summary-card-description">
<div class="summary-description">
{{ . }}
</div>
{{ end }}
<div class="summary-card-readmore">
<a href="{{ .Permalink }}">{{ i18n "see_posts" }} &rarr;</a>
<div class="summary-readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div>
</article>

View File

@@ -8,15 +8,5 @@
{{ . }}
{{ end }}
<div class="page-list">
{{ with .Paginator.Pages }}
{{ range . }}
{{ .Render "summary" }}
{{ end }}
{{ else }}
<div>
{{ i18n "no_posts" }}
</div>
{{ end }}
</div>
{{ partial "page-list.html" .Paginator.Pages }}
{{ end }}

View File

@@ -23,7 +23,7 @@
</div>
{{ end }}
{{ partial "featured-media.html" . }}
{{ partial "feature-figure.html" . }}
<div class="post-content" data-pagefind-body>
{{ .Content }}

View File

@@ -1,5 +1,5 @@
<article class="summary-card">
<h2 class="summary-card-title">
<article class="summary">
<h2 class="summary-title">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
@@ -8,14 +8,12 @@
{{ partial "page-metadata/series.html" . }}
{{ with .Summary }}
<div class="summary-card-description">
<div class="summary-description">
{{ . }}
</div>
{{ end }}
<div class="page-list page-list--series-inner">
{{ range .Data.Pages.Reverse }}
{{ .Render "summary" }}
{{ end }}
<div class="page-list page-list-series-inner">
{{ partial "page-list.html" .Data.Pages.Reverse }}
</div>
</article>

View File

@@ -10,10 +10,12 @@
{{ . }}
{{ end }}
<div class="page-list page-list--series">
<div class="page-list series">
{{ with .Paginator.Pages }}
{{ range . }}
{{ .Render "summary" }}
<div class="page series">
{{ .Render "summary" }}
</div>
{{ end }}
{{ else }}
<div>

View File

@@ -1,5 +1,5 @@
<article class="summary-card">
<h2 class="summary-card-title">
<article class="summary">
<h2 class="summary-title">
{{ with .Parent.Params.icon }}{{ partial "icon.html" . }}{{ end }}
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
{{ if .Draft }}{{ partial "icon.html" "write" }}{{ end }}
@@ -7,15 +7,15 @@
{{ partial "page-metadata/post-short.html" . }}
{{ partial "featured-media.html" . }}
{{ partial "feature-figure.html" . }}
{{ with .Summary }}
<div class="summary-card-description">
<div class="summary-description">
{{ . }}
</div>
{{ end }}
<div class="summary-card-readmore">
<div class="summary-readmore">
<a href="{{ .Permalink }}">{{ i18n "read_more" }} &rarr;</a>
</div>
</article>