diff --git a/assets/css/custom.css b/assets/css/custom.css index 0f28edb..f4c69b9 100644 --- a/assets/css/custom.css +++ b/assets/css/custom.css @@ -218,3 +218,30 @@ blockquote p { position: relative; z-index: 1; } + +/* Alert blockquotes */ +blockquote.alert { + padding: 0; + background-color: white; + box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1); +} +blockquote.alert::before{ + content:""; +} +blockquote.alert-warning { + border-color: #cb8e38; +} +.alert > .alert-heading { + padding: 1rem 1rem 0.5rem 1rem; + margin: 0; + font-weight: bolder; + color: #cb8e38; +} +.alert > .alert-content { + padding: 1rem 1rem 0.5rem 1rem; + margin: 0; + color: black; +} +.alert-warning > .alert-heading { + background-color: #fbf4ea; +} diff --git a/i18n/en.yml b/i18n/en.yml index b713328..57273c7 100644 --- a/i18n/en.yml +++ b/i18n/en.yml @@ -11,6 +11,8 @@ series-other: 'Other posts in this series: ' translations: Translations +old-post: This article was written more than two years ago. It may be obsolete. + previous: « Previous next: Next » diff --git a/i18n/fr.yml b/i18n/fr.yml index b84cf67..a5112eb 100644 --- a/i18n/fr.yml +++ b/i18n/fr.yml @@ -11,6 +11,8 @@ series-other: "Autres posts de cette série : " translations: Traductions +old-post: Cet article a été rédigé il y a plus de deux ans. Il est peut-être obsolète. + previous: « Précédent next: Suivant » diff --git a/layouts/_default/single.html b/layouts/_default/single.html index d8ebb8c..2148462 100644 --- a/layouts/_default/single.html +++ b/layouts/_default/single.html @@ -4,6 +4,19 @@ {{ partial "post/i18nlist.html" . }} + {{ $postDate := .Date }} + {{ $twoYearsAgo := now.AddDate -2 0 0 }} + {{ if lt $postDate $twoYearsAgo }} +
+

+ ⚠️ Warning +

+

+ {{ i18n "old-post" }} +

+
+ {{ end }} + {{ with .Resources }} {{ with .GetMatch "{cover.*}" }} {{ $cover := .Resize "820x" }}