mirror of https://github.com/lxndrblz/anatole.git

lxndrblz
11.09.2021 e4803723da018b6cc8c1f3735deda361b0f384ef
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
{{- if (eq .Site.Params.oldContentWarning true) -}}
  {{- $ageDays := div (sub now.Unix .Date.Unix) 86400 -}}
  {{- $duration := .Site.Params.oldContentDuration -}}
 
  {{- if and (ne .Type "post") (ne .Type .Site.Params.postSectionName) -}}
    {{- $duration = 0 -}}
 
 
  {{- end -}}
 
  {{- if (isset .Params "old_content_duration") -}}
    {{- $duration = .Params.old_content_duration -}}
 
 
  {{- end -}}
 
  {{- if and (gt $ageDays $duration) (ne $duration 0) -}}
    <div class="alert">
      <div id="indicator">!</div>
      {{ i18n "old_content_warning" (dict "Count" $duration) }}
    </div>
 
  {{- end -}}
 
 
{{- end -}}