fix: better fotmatting for post lists
This commit is contained in:
parent
b9fac3ffd1
commit
775942d331
5 changed files with 24 additions and 28 deletions
|
@ -350,4 +350,14 @@ code, kdb, pre {
|
|||
|
||||
.h-feed article:not(:last-child) {
|
||||
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;
|
||||
}
|
||||
|
|
11
themes/bcarlin/layouts/blog/list-item.html
Normal file
11
themes/bcarlin/layouts/blog/list-item.html
Normal 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>
|
|
@ -10,17 +10,7 @@
|
|||
<section>
|
||||
<h2>{{ .Key }}</h2>
|
||||
{{- range .Pages }}
|
||||
{{ $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>
|
||||
{{ .Summary }}
|
||||
</p>
|
||||
</article>
|
||||
{{ .Render "list-item" }}
|
||||
{{- end }}
|
||||
</section>
|
||||
{{- end }}
|
||||
|
|
|
@ -10,17 +10,7 @@
|
|||
<h2 class="p-name">Recent posts</h2>
|
||||
{{- $posts := where .Site.RegularPages "Section" "blog" }}
|
||||
{{- range first 5 $posts }}
|
||||
{{ $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>
|
||||
{{ .Summary }}
|
||||
</p>
|
||||
</article>
|
||||
{{ .Render "list-item" }}
|
||||
{{- end }}
|
||||
</section>
|
||||
</article>
|
||||
|
|
|
@ -7,12 +7,7 @@
|
|||
{{ .Content }}
|
||||
|
||||
{{ range .Pages.ByDate }}
|
||||
{{ $dateMachine := .Date | time.Format "2006-01-02T15:04:05-07:00" }}
|
||||
{{ $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>
|
||||
{{ .Render "list-item" }}
|
||||
{{ end }}
|
||||
</article>
|
||||
{{ end }}
|
||||
|
|
Loading…
Add table
Reference in a new issue