fix: better fotmatting for post lists

This commit is contained in:
Bruno Carlin 2025-06-17 01:35:34 +02:00
parent b9fac3ffd1
commit 775942d331
WARNING! Although there is a key with this ID in the database it does not verify this commit! This commit is SUSPICIOUS.
GPG key ID: 8E254EA0FFEB9B6D
5 changed files with 24 additions and 28 deletions

View file

@ -350,4 +350,14 @@ code, kdb, pre {
.h-feed article:not(:last-child) { .h-feed article:not(:last-child) {
border-bottom: var(--pico-border-width) solid var(--pico-card-border-color); border-bottom: var(--pico-border-width) solid var(--pico-card-border-color);
margin-bottom: 0;
}
.h-feed article p {
margin-bottom: calc(0.2 * var(--pico-typography-spacing-vertical));
}
.h-feed article .p-summary {
font-size: 0.9em;
font-style: italic;
} }

View file

@ -0,0 +1,11 @@
{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }}
{{ $dateHuman := .Date | time.Format "2006-01-02" }}
<article class="h-entry">
<p>
<a class="u-url p-name" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
(<time class="dt-published" datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>)
</p>
<p class="p-summary">
{{ .Summary }}
</p>
</article>

View file

@ -10,17 +10,7 @@
<section> <section>
<h2>{{ .Key }}</h2> <h2>{{ .Key }}</h2>
{{- range .Pages }} {{- range .Pages }}
{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }} {{ .Render "list-item" }}
{{ $dateHuman := .Date | time.Format "2006-01-02" }}
<article class="h-entry">
<p>
<a class="u-url p-name" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
(<time class="dt-published" datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>)
</p>
<p>
{{ .Summary }}
</p>
</article>
{{- end }} {{- end }}
</section> </section>
{{- end }} {{- end }}

View file

@ -10,17 +10,7 @@
<h2 class="p-name">Recent posts</h2> <h2 class="p-name">Recent posts</h2>
{{- $posts := where .Site.RegularPages "Section" "blog" }} {{- $posts := where .Site.RegularPages "Section" "blog" }}
{{- range first 5 $posts }} {{- range first 5 $posts }}
{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }} {{ .Render "list-item" }}
{{ $dateHuman := .Date | time.Format "2006-01-02" }}
<article class="h-entry">
<p>
<a class="u-url p-name" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
(<time class="dt-published" datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>)
</p>
<p>
{{ .Summary }}
</p>
</article>
{{- end }} {{- end }}
</section> </section>
</article> </article>

View file

@ -7,12 +7,7 @@
{{ .Content }} {{ .Content }}
{{ range .Pages.ByDate }} {{ range .Pages.ByDate }}
{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }} {{ .Render "list-item" }}
{{ $dateHuman := .Date | time.Format "2006-01-02" }}
<article class="h-entry">
<a class="u-url p-name" href="{{ .RelPermalink }}">{{ .LinkTitle }}</a>
(<time class="dt-published" datetime="{{ $dateMachine }}">{{ $dateHuman }}</time>)
</article>
{{ end }} {{ end }}
</article> </article>
{{ end }} {{ end }}