Skip to content

Commit 45ee20c

Browse files
committed
style(post_meta): adjust indentation for better readability
1 parent 7ede445 commit 45ee20c

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

layouts/_partials/post_meta.html

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
{{- $scratch := newScratch }}
22

33
{{- if not .Date.IsZero -}}
4-
{{- $scratch.Add "meta" (slice (printf "<span title='%s'>%s</span>" (.Date) (.Date | time.Format (default ":date_long" site.Params.DateFormat)))) }}
4+
{{- $scratch.Add "meta" (slice (printf "<span title='%s'>%s</span>" (.Date) (.Date | time.Format (default ":date_long" site.Params.DateFormat)))) }}
55
{{- end }}
66

77
{{- if (.Param "ShowReadingTime") -}}
8-
{{- $scratch.Add "meta" (slice (printf "<span>%s</span>" (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime)))) }}
8+
{{- $scratch.Add "meta" (slice (printf "<span>%s</span>" (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime)))) }}
99
{{- end }}
1010

1111
{{- if (.Param "ShowWordCount") -}}
12-
{{- $scratch.Add "meta" (slice (printf "<span>%s</span>" (i18n "words" .WordCount | default (printf "%d words" .WordCount)))) }}
12+
{{- $scratch.Add "meta" (slice (printf "<span>%s</span>" (i18n "words" .WordCount | default (printf "%d words" .WordCount)))) }}
1313
{{- end }}
1414

1515
{{- if not (.Param "hideAuthor") -}}
16-
{{- with (partial "author.html" .) }}
17-
{{- $scratch.Add "meta" (slice (printf "<span>%s</span>" .)) }}
18-
{{- end }}
16+
{{- with (partial "author.html" .) }}
17+
{{- $scratch.Add "meta" (slice (printf "<span>%s</span>" .)) }}
18+
{{- end }}
1919
{{- end }}
2020

21+
{{/* Combine all meta information into a single string with separators and render it as HTML.*/}}
22+
2123
{{- with ($scratch.Get "meta") }}
22-
{{- delimit . "&nbsp;·&nbsp;" | safeHTML -}}
24+
{{- delimit . "&nbsp;·&nbsp;" | safeHTML -}}
2325
{{- end -}}

0 commit comments

Comments
 (0)