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
15 changed files with 135 additions and 124 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%;
}
@@ -784,20 +765,20 @@ figcaption {
*/
.related-posts > hr,
.related-posts > h2 {
.related-posts > h1 {
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

@@ -21,6 +21,11 @@ taxonomies:
outputs:
page:
- html
- markdown
outputFormats:
markdown:
ugly: true
privacy:
googleAnalytics:

View File

@@ -32,6 +32,9 @@ readingtime:
edit_history:
other: "Edit history"
view_markdown:
other: "View raw"
# Post count
no_posts:
@@ -45,8 +48,6 @@ post_count:
# Navigation
read_more:
other: "Read more"
see_posts:
other: "See posts"
related_posts:
other: "Related Posts"
@@ -71,6 +72,9 @@ aria_rss_link:
aria_post_meta_edit_history:
other: "link to page edit history"
aria_post_meta_view_markdown:
other: "link to view raw markdown code of page"
aria_post_meta_categories:
other: "categories"

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

@@ -0,0 +1,8 @@
{{ with .OutputFormats.Get "markdown" }}
<span class="page-metadata-item post-meta-view-markdown" aria-label="{{ i18n "aria_post_meta_view_markdown" }}">
{{ partial "icon.html" "code" }}
<a href="{{ .Permalink }}" target="_blank">
{{- i18n "view_markdown" -}}
</a>
</span>
{{ end }}

View File

@@ -20,6 +20,7 @@
{{ partial "page-metadata/item/authors.html" . }}
{{ partial "page-metadata/item/readingtime.html" . }}
{{ partial "page-metadata/item/edithistory.html" . }}
{{ partial "page-metadata/item/viewraw.html" . }}
{{ partial "page-metadata/item/comments-counter.html" . }}
{{ partial "page-metadata/item/categories.html" . }}

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 }}
@@ -79,7 +79,7 @@
{{ with $related }}
<div class="related-posts">
<hr>
<h2>{{ i18n "related_posts" }}</h2>
<h1>{{ i18n "related_posts" }}</h1>
{{ partial "page-list.html" . }}
</div>
{{ end }}

9
layouts/page.markdown.md Normal file
View File

@@ -0,0 +1,9 @@
{{ with .File -}}
{{ with (.Path | readFile) -}}
{{ . -}}
{{ else -}}
{{ errorf "file not found: %s" .Path -}}
{{ end -}}
{{ else -}}
{{ errorf "no file available for markdown template?" -}}
{{ end -}}

View File

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

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>