home cards

This commit is contained in:
2026-06-22 11:08:49 +02:00
parent 96296bbed9
commit 5c66612821
5 changed files with 105 additions and 25 deletions

View File

@@ -97,36 +97,38 @@
// CONTENUS DES CARTES
//--------------------------------------------------------------------------
const { items: homeTousOrchestre } = useStrapi(
"/api/__strapi__/home-tous-orchestre",
const { items: homeCardsTousOrchestre } = useStrapi(
"/api/__strapi__/home-cards",
{
locale: "fr-FR",
populate: {
carte: {
illustration: true,
illustration: true,
},
filters: {
type: {
$eq: "Tous à l'orchestre",
},
},
limit: 1,
sort: "ordre:asc",
pageSize: 100,
}
)
const homeTousOrchestreContent = computed(() => homeTousOrchestre.value?.[0] || null)
const cards = computed(() => {
const cartes = homeTousOrchestreContent.value?.carte || []
const publishedCards = cartes.filter((carte) => carte.publication !== false)
const publishedCards = homeCardsTousOrchestre.value.filter((carte) => carte.publication !== false)
return publishedCards.map((carte, index) => {
const image = getStrapiCardImage(carte)
const category = carte.categorie || ""
const title = carte.titre || ""
return {
id: carte.id || String(index + 1),
imgSrc: image?.url || "",
imgAlt: image?.alternativeText || image?.caption || carte.titre || "",
imgAlt: image?.alternativeText || image?.caption || title,
imgWidth: image?.width || undefined,
imgHeight: image?.height || undefined,
title: carte.titre || "",
title,
descriptionBlocks: carte.description || null,
tags: category ? [category] : [],
url: carte.url || "",

View File

@@ -12,7 +12,7 @@
<!-- Content -->
<div class="concert-card__content">
<NuxtLink v-if="href" :to="href" class="concert-card__link">
<DsHeading as="h4" tone="default" class="concert-card__title">
<DsHeading as="h4" tone="default" class="concert-card__title uppercase">
{{ title }}
</DsHeading>
</NuxtLink>