Highlight old posts in Hugo

I added a small notice that appears on posts older than a year. It was important to me that this notice not show up on photo-only posts — after all, photos rarely lose their relevance. First I wrote a working version myself, then had a language model further optimize the code. Now I’m running the following variant: {{- /* Tags prüfen */ -}} {{- $tags := default (slice) .Params.tags -}} {{- $tagsLower := apply $tags "lower" "." -}} {{- $hasPhoto := in $tagsLower "photo" -}} {{- /* Relevantes Datum bestimmen und Stichtag berechnen */ -}} {{- $pageDate := time.AsTime (or .Lastmod .PublishDate .Date) -}} {{- $oneYearAgo := (now).AddDate -1 0 0 -}} {{- /*Hinweis nur auf echten Seiten, mit gültigem Datum, älter als 1 Jahr und nicht beim Tag "photo" */ -}} {{- if and .IsPage (not $hasPhoto) (gt ($pageDate.Unix) 0) (lt $pageDate $oneYearAgo) -}} <div class="alert alert-warning"> Hinweis: Dieser Artikel ist über ein Jahr alt. Die Informationen könnten veraltet sein. </div> {{- end -}} The text was automatically translated from German into English. The German quotations were also translated in sense. ...

October 21, 2025 · 1 min · 182 words

website-monitor

Most people are probably already familiar with Uptime Kuma. If you’re looking to try something new, check out »website-monitor«. This tool is much simpler and doesn’t come with unnecessary bloat. Update 2025-02-15 19:14 The project was removed from GitHub; I’ve updated the link. The text was automatically translated from German into English. The German quotations were also translated in sense.

February 15, 2025 · 1 min · 60 words