Improve list header sections

This commit is contained in:
JP Hastings-Spital 2023-09-11 22:14:45 +01:00
parent bad02e30ab
commit 2a2f63ed8a
4 changed files with 48 additions and 14 deletions

View file

@ -2,6 +2,8 @@
{{ $paginator := .Paginate .Data.Pages }}
<main class="posts">
{{ partial "generic-list-header.html" . }}
<h1>{{ title (replace .Title "-" " ") }}</h1>
{{ if .Content }}

View file

@ -0,0 +1,25 @@
<div class="post-info">
<p>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-calendar">
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
<line x1="16" y1="2" x2="16" y2="6"></line>
<line x1="8" y1="2" x2="8" y2="6"></line>
<line x1="3" y1="10" x2="21" y2="10"></line>
</svg>
Last updated
{{ partial "year-relative-date.html" .Lastmod }}
</p>
<p>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-hash">
<line x1="4" y1="9" x2="20" y2="9"></line>
<line x1="4" y1="15" x2="20" y2="15"></line>
<line x1="10" y1="3" x2="8" y2="21"></line>
<line x1="16" y1="3" x2="14" y2="21"></line>
</svg>
{{ len .Data.Pages }} posts
</p>
<p class="author h-card" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>
<a href="{{ .Site.BaseURL | absURL }}" rel="author" class="p-author u-url">{{ .Site.Author.name }}</a>
</p>
</div>

View file

@ -1,14 +1,4 @@
<div class="post-info">
<p class="breadcrumbs">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-compass">
<circle cx="12" cy="12" r="10"></circle>
<polygon points="16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"></polygon>
</svg>
{{- range .Ancestors.Reverse }}
{{ if ne .RelPermalink "/" }}<a href="{{ .RelPermalink }}">{{ .Title }}</a> » {{end}}
{{- end }}
{{ .Title }}
</p>
<p>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-calendar">
<rect x="3" y="4" width="18" height="18" rx="2" ry="2"></rect>
@ -19,13 +9,28 @@
Last updated
{{ partial "year-relative-date.html" .Lastmod }}
</p>
<p class="reading-time">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-clock">
<p class="breadcrumbs">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-compass">
<circle cx="12" cy="12" r="10"></circle>
<polyline points="12 6 12 12 16 14"></polyline>
<polygon points="16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"></polygon>
</svg>
{{ i18n "readingTime" .Page.ReadingTime }}
In:
{{- range .Ancestors.Reverse }}
{{ if ne .RelPermalink "/" }}<a href="{{ .RelPermalink }}">{{ .Title }}</a> » {{end}}
{{- end }}
<a href="{{ .RelPermalink }}">{{ .Title }}</a>
</p>
{{ if gt (len .Data.Pages) 0 }}
<p>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-hash">
<line x1="4" y1="9" x2="20" y2="9"></line>
<line x1="4" y1="15" x2="20" y2="15"></line>
<line x1="10" y1="3" x2="8" y2="21"></line>
<line x1="16" y1="3" x2="14" y2="21"></line>
</svg>
{{ len .Data.Pages }} posts
</p>
{{ end }}
<p class="author h-card" aria-hidden="true">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>
<a href="{{ .Site.BaseURL | absURL }}" rel="author" class="p-author u-url">{{ .Site.Author.name }}</a>

View file

@ -2,6 +2,8 @@
{{ $paginator := .Paginate .Data.Pages }}
<main class="posts instagram">
{{ partial "generic-list-header.html" . }}
<h1>{{ title (replace .Title "-" " ") }}</h1>
{{ if .Content }}