diff options
| author | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2020-10-20 18:38:29 +0530 |
|---|---|---|
| committer | Aditya Telange <21258296+adityatelange@users.noreply.github.com> | 2020-10-22 16:53:24 +0530 |
| commit | 684cb2160fc84a75e17c5d423c000dc94487839e (patch) | |
| tree | 5ce234e32c72f1efecfc419454f3b1b52c53f56c | |
| parent | 3d6037049459a0dec8a5797021f1ee39267fd725 (diff) | |
layouts: post_meta as partial
| -rw-r--r-- | layouts/_default/archives.html | 8 | ||||
| -rw-r--r-- | layouts/_default/list.html | 6 | ||||
| -rw-r--r-- | layouts/_default/single.html | 6 | ||||
| -rw-r--r-- | layouts/partials/post_meta.html | 5 |
4 files changed, 9 insertions, 16 deletions
diff --git a/layouts/_default/archives.html b/layouts/_default/archives.html index e2e6993..b63460b 100644 --- a/layouts/_default/archives.html +++ b/layouts/_default/archives.html @@ -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 }} · - {{- $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" . -}} </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 */}}
\ No newline at end of file +{{- end }}{{/* end main */}} diff --git a/layouts/_default/list.html b/layouts/_default/list.html index 3596a93..dad1d3c 100644 --- a/layouts/_default/list.html +++ b/layouts/_default/list.html @@ -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 }} · - {{- $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" . -}} </footer> <a class="entry-link" aria-label="post link to {{ .Title | plainify }}" href="{{ .Permalink }}"></a> </article> diff --git a/layouts/_default/single.html b/layouts/_default/single.html index 20c3bc9..b13fb74 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -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 -}} · - {{- $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 -}} | <ul class="i18n_list"> {{- i18n "translations" | default "Translations"}}: diff --git a/layouts/partials/post_meta.html b/layouts/partials/post_meta.html new file mode 100644 index 0000000..dd3b9a5 --- /dev/null +++ b/layouts/partials/post_meta.html @@ -0,0 +1,5 @@ +<time>{{ .Date.Format (default "January 2, 2006" .Site.Params.DateFormat) }}</time> +{{- 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 }} |
