mirror of
https://github.com/Brandon-Rozek/website-theme.git
synced 2024-10-30 01:42:08 -04:00
24 lines
591 B
HTML
24 lines
591 B
HTML
|
|
||
|
{{ if and (not .Date.IsZero) .Site.Params.warnPostOlderThanXYears }}
|
||
|
|
||
|
|
||
|
{{ $ageYears := div (sub now.Unix .Date.Unix) 31536000 }}
|
||
|
|
||
|
{{ if .Lastmod }}
|
||
|
{{ $ageYears := div (sub now.Unix .Lastmod.Unix) 31536000 }}
|
||
|
{{ end }}
|
||
|
|
||
|
{{ if gt $ageYears .Site.Params.warnPostOlderThanXYears }}
|
||
|
<div style="margin-top: 1rem; border: 1px solid black; padding: 1rem;">
|
||
|
<em>Warning</em>: This post has not been modified
|
||
|
for over {{ .Site.Params.warnPostOlderThanXYears }} years. For technical posts,
|
||
|
make sure that it is still relevant.
|
||
|
</div>
|
||
|
{{ end }}
|
||
|
|
||
|
|
||
|
{{ end }}
|
||
|
|
||
|
|
||
|
|