layouts/partials/post-meta.html, layouts/_default/single.html, layouts/_default/list.html: use same post meta for post page and list

This commit is contained in:
revsuine 2024-11-25 15:48:37 +00:00
parent fa3123d2a6
commit c0a6202435
Signed by: revsuine
GPG key ID: 3F257B68F5BC9339
3 changed files with 22 additions and 29 deletions

View file

@ -10,16 +10,7 @@
<h2 class="post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h2>
<div class="post-meta">
{{- if .Date -}}
<time class="post-date">
{{- partial "post-date" . -}}
</time>
{{- end -}}
{{- with .Params.Author -}}
<span class="post-author">{{- . -}}</span>
{{- end -}}
</div>
{{ partial "post-meta.html" . }}
{{ if .Params.tags }}
<span class="post-tags">

View file

@ -3,25 +3,7 @@
<h1 class="post-title">
<a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
</h1>
<div class="post-meta">
{{- if .Date -}}
<time class="post-date">
{{- partial "post-date" . -}}
{{- if and $.Site.Params.showLastUpdated .Lastmod -}}
&nbsp;{{- partial "post-lastmod" . -}}
{{- end -}}
</time>
{{- end -}}
{{- with .Params.Author -}}
<span class="post-author">{{ . }}</span>
{{- end -}}
{{- if and (.Param "readingTime") (eq (.Param "readingTime") true) -}}
<span class="post-reading-time">{{ .ReadingTime }} {{ $.Site.Params.minuteReadingTime | default "min read" }}</span>
{{- end -}}
{{- if and (.Params.showWordCount | default .Site.Params.showWordCount) (eq (.Param "showWordCount") true) -}}
<span class="post-word-count">{{ .WordCount }} {{ $.Site.Params.words | default "words" }}</span>
{{- end -}}
</div>
{{ partial "post-meta.html" . }}
{{ if .Params.tags }}
<span class="post-tags">

View file

@ -0,0 +1,20 @@
<div class="post-meta">
{{- if .Date -}}
<time class="post-date">
{{- partial "post-date" . -}}
{{- if and $.Site.Params.showLastUpdated .Lastmod -}}
&nbsp;{{- partial "post-lastmod" . -}}
{{- end -}}
</time>
{{- end -}}
{{- with .Params.Author -}}
<span class="post-author">{{ . }}</span>
{{- end -}}
{{- if and (.Param "readingTime") (eq (.Param "readingTime") true) -}}
<span class="post-reading-time">{{ .ReadingTime }} {{ $.Site.Params.minuteReadingTime | default "min read" }}</span>
{{- end -}}
{{- if and (.Params.showWordCount | default .Site.Params.showWordCount) (eq (.Param "showWordCount") true) -}}
<span class="post-word-count">{{ .WordCount }} {{ $.Site.Params.words | default "words" }}</span>
{{- end -}}
</div>