aboutsummaryrefslogtreecommitdiff
path: root/themes/default/layouts/partials/function-content.html
blob: de68946f8c9728d658a2401c9a281c288074d1d7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
{{- $context := . -}}
{{- $content := $context.Content -}}
{{- $expired := and .ExpiryDate (ge now.Unix .ExpiryDate.Unix) -}}
{{- $empty := eq (len $content) 0 -}}

{{-
  $content = $content |
    replaceRE "<p><figure>"   "<figure>"  |
    replaceRE "<p>\n<figure>" "<figure>"  |
    replaceRE "</figure></p>" "</figure>" |
-}}

{{- if $empty -}}
 {{- $content = "This message contains no content." -}}
{{- end -}}

{{- if $expired -}}
 {{- $content = "This message has expired." -}}
{{- end -}}

{{- return $content -}}