Skip to content

Commit

Permalink
Merge pull request #79 from NUSGreyhats/fix_post_metadata
Browse files Browse the repository at this point in the history
fix rendering of html entities
  • Loading branch information
caprinux authored Nov 18, 2023
2 parents 568660a + 2c8e651 commit eb2c407
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions themes/PaperMod/layouts/partials/post_meta.html
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
{{- $scratch := newScratch }}

{{- if not .Date.IsZero -}}
{{- $scratch.Add "meta" (slice (.Date.Format (default "January 2, 2006" .Site.Params.DateFormat))) }}
{{- $scratch.Add "meta" (slice (printf "<span title='%s'>%s</span>" (.Date) (.Date | time.Format (default "January 2, 2006" site.Params.DateFormat)))) }}
{{- end }}

{{- if (.Param "ShowReadingTime") -}}
{{- $scratch.Add "meta" (slice (i18n "read_time" .ReadingTime | default (printf "%d min" .ReadingTime))) }}
{{- end }}

{{- if (.Param "ShowWordCount") -}}
{{- $scratch.Add "meta" (slice (i18n "words" .WordCount | default (printf "%d words" .WordCount))) }}
{{- end }}

{{- if not (.Param "hideAuthor") -}}
{{- with (partial "author.html" .) }}
{{- $scratch.Add "meta" (slice .) }}
{{- end }}
{{- end }}

{{- with ($scratch.Get "meta") }}
{{- delimit . "&nbsp;·&nbsp;" -}}
{{- delimit . "&nbsp;·&nbsp;" | safeHTML -}}
{{- end -}}

0 comments on commit eb2c407

Please sign in to comment.