layouts: post_meta as partial

This commit is contained in:
Aditya Telange 2020-10-20 18:38:29 +05:30
parent 3d60370494
commit 684cb2160f
4 changed files with 9 additions and 16 deletions

View File

@ -22,11 +22,7 @@
{{- .Title | markdownify }}
</h3>
<div class="archive-meta">
<time>{{ .Date.Format (default "January 2, 2006" .Site.Params.DateFormat) }}</time>
{{- if $.Site.Params.ShowReadingTime }}&nbsp;·&nbsp;
{{- $default_txt := print .ReadingTime " " "min" }}
{{- i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
{{- if or .Params.author .Site.Params.author }}&nbsp;·&nbsp;{{- .Params.author | default .Site.Params.author }}{{ end }}
{{- partial "post_meta.html" . -}}
</div>
<a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a>
</div>
@ -39,4 +35,4 @@
{{- end }}
{{- end }}
{{- end }}{{/* end main */}}
{{- end }}{{/* end main */}}

View File

@ -44,11 +44,7 @@
</section>
{{- end }}
<footer class="entry-footer">
<time>{{ .Date.Format (default "January 2, 2006" .Site.Params.DateFormat) }}</time>
{{- if $.Site.Params.ShowReadingTime }}&nbsp;·&nbsp;
{{- $default_txt := print .ReadingTime " " "min" }}
{{- i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
{{- if or .Params.author .Site.Params.author }}&nbsp;·&nbsp;{{- .Params.author | default .Site.Params.author }}{{ end }}
{{- partial "post_meta.html" . -}}
</footer>
<a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a>
</article>

View File

@ -8,11 +8,7 @@
</h1>
{{- if .Params.hideMeta }}{{ else }}
<div class="post-meta">
<time>{{ .Date.Format (default "January 2, 2006" .Site.Params.DateFormat) }}</time>
{{- if $.Site.Params.ShowReadingTime -}}&nbsp;·&nbsp;
{{- $default_txt := print .ReadingTime " " "min" }}
{{- i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
{{- if or .Params.author .Site.Params.author }}&nbsp;·&nbsp;{{- .Params.author | default .Site.Params.author }}{{ end }}
{{- partial "post_meta.html" . -}}
{{- if .IsTranslated -}}&nbsp;|&nbsp;
<ul class="i18n_list">
{{- i18n "translations" | default "Translations"}}:

View File

@ -0,0 +1,5 @@
<time>{{ .Date.Format (default "January 2, 2006" .Site.Params.DateFormat) }}</time>
{{- if $.Site.Params.ShowReadingTime -}}&nbsp;·&nbsp;
{{- $default_txt := print .ReadingTime " " "min" }}
{{- i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
{{- if or .Params.author .Site.Params.author }}&nbsp;·&nbsp;{{- .Params.author | default .Site.Params.author }}{{ end }}