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:
parent
fa3123d2a6
commit
c0a6202435
3 changed files with 22 additions and 29 deletions
|
@ -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">
|
||||
|
|
|
@ -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 -}}
|
||||
{{- 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">
|
||||
|
|
20
layouts/partials/post-meta.html
Normal file
20
layouts/partials/post-meta.html
Normal file
|
@ -0,0 +1,20 @@
|
|||
<div class="post-meta">
|
||||
{{- if .Date -}}
|
||||
<time class="post-date">
|
||||
{{- partial "post-date" . -}}
|
||||
{{- if and $.Site.Params.showLastUpdated .Lastmod -}}
|
||||
{{- 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>
|
||||
|
Loading…
Reference in a new issue