mirror of
https://github.com/by-jp/www.byjp.me.git
synced 2025-08-09 05:36:07 +01:00
Improve list header sections
This commit is contained in:
parent
bad02e30ab
commit
2a2f63ed8a
4 changed files with 48 additions and 14 deletions
|
@ -2,6 +2,8 @@
|
|||
{{ $paginator := .Paginate .Data.Pages }}
|
||||
|
||||
<main class="posts">
|
||||
{{ partial "generic-list-header.html" . }}
|
||||
|
||||
<h1>{{ title (replace .Title "-" " ") }}</h1>
|
||||
|
||||
{{ if .Content }}
|
||||
|
|
25
layouts/partials/generic-list-header.html
Normal file
25
layouts/partials/generic-list-header.html
Normal 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>
|
|
@ -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>
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
{{ $paginator := .Paginate .Data.Pages }}
|
||||
|
||||
<main class="posts instagram">
|
||||
{{ partial "generic-list-header.html" . }}
|
||||
|
||||
<h1>{{ title (replace .Title "-" " ") }}</h1>
|
||||
|
||||
{{ if .Content }}
|
||||
|
|
Loading…
Reference in a new issue