-
- {{- if $.Site.Params.ShowReadingTime }} ·
- {{- $default_txt := print .ReadingTime " " "min" }}
- {{- i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
- {{- if or .Params.author .Site.Params.author }} · {{- .Params.author | default .Site.Params.author }}{{ end }}
+ {{- partial "post_meta.html" . -}}
@@ -39,4 +35,4 @@
{{- end }}
{{- end }}
-{{- end }}{{/* end main */}}
\ No newline at end of file
+{{- end }}{{/* end main */}}
diff --git a/layouts/_default/list.html b/layouts/_default/list.html
index 3596a931..dad1d3ce 100644
--- a/layouts/_default/list.html
+++ b/layouts/_default/list.html
@@ -44,11 +44,7 @@
{{- end }}
diff --git a/layouts/_default/single.html b/layouts/_default/single.html
index 20c3bc93..b13fb74a 100644
--- a/layouts/_default/single.html
+++ b/layouts/_default/single.html
@@ -8,11 +8,7 @@
{{- if .Params.hideMeta }}{{ else }}
-
- {{- if $.Site.Params.ShowReadingTime -}} ·
- {{- $default_txt := print .ReadingTime " " "min" }}
- {{- i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
- {{- if or .Params.author .Site.Params.author }} · {{- .Params.author | default .Site.Params.author }}{{ end }}
+ {{- partial "post_meta.html" . -}}
{{- if .IsTranslated -}} |
{{- i18n "translations" | default "Translations"}}:
diff --git a/layouts/partials/post_meta.html b/layouts/partials/post_meta.html
new file mode 100644
index 00000000..dd3b9a5c
--- /dev/null
+++ b/layouts/partials/post_meta.html
@@ -0,0 +1,5 @@
+
+{{- if $.Site.Params.ShowReadingTime -}} ·
+{{- $default_txt := print .ReadingTime " " "min" }}
+{{- i18n "read_time" .ReadingTime | default $default_txt }}{{ end }}
+{{- if or .Params.author .Site.Params.author }} · {{- .Params.author | default .Site.Params.author }}{{ end }}