lives: affiche un avertissement pour les annonces

surcharge certains éléments du thème, afin d'afficher un avertissement
pour mettre en évidence les billets qui sont des annonces de prochain
live.

Co-Authored-by: iGor milhit <igor@milhit.ch>
dev
iGor milhit 2024-12-08 09:10:11 +01:00
parent 6392100ca3
commit eeece83476
Signed by: igor
GPG Key ID: 692D97C3D0228A99
6 changed files with 62 additions and 2 deletions

View File

@ -2,7 +2,8 @@
title: "10ᵉ live" title: "10ᵉ live"
date: 2024-11-16T19:44:53+01:00 date: 2024-11-16T19:44:53+01:00
draft: false draft: false
announce: false params:
announce: false
categories: ["musique"] categories: ["musique"]
tags: ["streaming", "listening", "live"] tags: ["streaming", "listening", "live"]
slug: 10e-live slug: 10e-live

2
i18n/en.toml 100644
View File

@ -0,0 +1,2 @@
announcedLive = "Announce of the next live!"
announce = "Announce!"

2
i18n/fr.toml 100644
View File

@ -0,0 +1,2 @@
announcedLive = "Annonce du prochain live!"
announce = "Annonce!"

View File

@ -0,0 +1,34 @@
{{ define "main" }}
<header>
<h2>{{.Title}}</h2>
</header>
<!-- "{{.Content}}" pulls from the markdown content of the corresponding
_index.md -->
<main>
<header>
{{.Content }}
</header>
<section class="posts-list">
<!--
Ranges pages by the publish date, in reverse order, to display the
post titles of the section from most recent to older. If the pages
has the parameter announce, then it displays a marked warning.
-->
{{ range .Pages.ByPublishDate.Reverse }}
<article>
{{ if .Params.Announce }}
<a href="{{ .Permalink }}"
title="{{ i18n "announcedLive" }}">
{{- .Title -}}
</a> <mark>{{ i18n "announce" }}</mark>
{{ else }}
<a href="{{ .Permalink }}">
{{- .Title -}}
</a>
{{ end }}
{{ partial "lists-footer.html" . }}
</article>
{{ end }}
</section>
</main>
{{ end }}

View File

@ -0,0 +1,21 @@
<section class="home-posts-list">
<h2>{{ i18n "lastPosts" }}</h2>
<!--
Ranges regular pages by the publish date, in reverse order, to display the
post titles of the section from most recent to older, and the category.
-->
{{ range first 5 .Site.RegularPages.ByPublishDate.Reverse }}
<article>
{{ if .Params.Announce }}
<a href="{{ .Permalink }}"
title="{{ i18n "announcedLive" }}">
{{- .Title -}}
</a> <mark>{{ i18n "announce" }}</mark>
{{ else }}
<a href="{{ .Permalink }}">
{{- .Title -}}
</a>
{{ end }}
</article>
{{ end }}
</section>

@ -1 +1 @@
Subproject commit 0c6ae76ed93490439f4ffcaf28232a9b4f727011 Subproject commit 264fc3480e6eb9f7a21df632eefe9e596cb174b3