Compare commits

...

3 commits

Author SHA1 Message Date
d3b32228db Traduction EN/AR du post Enigma et support i18n pour le blog photo 2026-02-17 09:45:41 +01:00
1c2f21363e Remplacement du div onclick par un lien dans posts-loop (accessibilité)
La carte de post utilisait un div avec onclick="location.href=..." pour la navigation. Remplacé par un <a> sémantique avec le <a> interne du titre transformé en <span> pour éviter l'imbrication de liens invalide.
2026-02-17 09:45:34 +01:00
b9992ead61 Ajout du champ lang à la collection photoBlogPosts 2026-02-17 08:57:07 +01:00
7 changed files with 55 additions and 16 deletions

View file

@ -15,20 +15,19 @@ const postsLoop = allPosts.slice(0, count).map((post) => {
{
postsLoop.map((post) => {
return (
<div
class="relative border border-transparent border-dashed cursor-pointer p-7 group rounded-2xl"
onclick={`location.href = '${post.link}'`}
<a
href={post.link}
class="relative block border border-transparent border-dashed p-7 group rounded-2xl no-underline text-inherit"
>
<div class="absolute inset-0 z-20 w-full h-full duration-300 ease-out bg-white border border-dashed dark:bg-neutral-950 rounded-2xl border-neutral-300 dark:border-neutral-600 group-hover:-translate-x-1 group-hover:-translate-y-1" />
<div class="absolute inset-0 z-10 w-full h-full duration-300 ease-out border border-dashed rounded-2xl border-neutral-300 dark:border-neutral-600 group-hover:translate-x-1 group-hover:translate-y-1" />
<div class="relative z-30 duration-300 ease-out group-hover:-translate-x-1 group-hover:-translate-y-1">
<h2 class="flex items-center mb-3">
<a
href={post.link}
<span
class="text-xl font-bold leading-tight tracking-tight sm:text-2xl dark:text-neutral-100"
>
{post.title}
</a>
</span>
<svg
class="group-hover:translate-x-0 flex-shrink-0 translate-y-0.5 -translate-x-1 w-2.5 h-2.5 stroke-current ml-1 transition-all ease-in-out duration-200 transform"
viewBox="0 0 13 15"
@ -76,7 +75,7 @@ const postsLoop = allPosts.slice(0, count).map((post) => {
Posted on {post.dateFormatted}
</div>
</div>
</div>
</a>
)
})
}

View file

@ -75,6 +75,7 @@ const photoBlogPostsCollection = defineCollection({
tags: z.array(z.string()).optional(),
featured: z.boolean().default(false),
draft: z.boolean().default(false),
lang: z.enum(['fr', 'en', 'ar']).default('fr'),
}),
});

View file

@ -0,0 +1,17 @@
---
title: "إنيغما"
description: |
إنيغما كانت مسابقة بحث عن الكنز بين المدارس نظّمها المركز العالي للدراسات CESIM يوم السبت، تحت عنوان «البحث عن كنز ابن بطوطة المنسي». 4 فرق طنجاوية دُعيت لتمثيل مؤسساتها.
تغطية.
date: 2015-04-25
coverImage: "../../assets/images/photos/blog/enigma/01-Enigma-v1.jpg"
tags: []
featured: true
draft: false
lang: ar
---
إنيغما كانت مسابقة بحث عن الكنز بين المدارس نظّمها [CESIM](https://ecolesuperieure.ma/ecole/cesim/) يوم السبت، تحت عنوان «البحث عن كنز ابن بطوطة المنسي». 4 فرق طنجاوية دُعيت لتمثيل مؤسساتها.
تغطية.

View file

@ -0,0 +1,17 @@
---
title: "Enigma"
description: |
Enigma was an inter-school treasure hunt organized this saturday by the CESIM, on the theme "In search of forgotten treasure of Ibn Battuta". 4 Tangier teams were invited to represent their respective institutions.
Recap.
date: 2015-04-25
coverImage: "../../assets/images/photos/blog/enigma/01-Enigma-v1.jpg"
tags: []
featured: true
draft: false
lang: en
---
Enigma was an inter-school treasure hunt organized this saturday by the [CESIM](https://ecolesuperieure.ma/ecole/cesim/), on the theme "In search of forgotten treasure of Ibn Battuta". 4 Tangier teams were invited to represent their respective institutions.
Recap.

View file

@ -1,6 +1,9 @@
---
title: "Enigma"
description: "Série artistique en noir et blanc"
description: |
Enigma était une chasse au trésor inter-écoles organisée ce samedi par le CESIM, sur le thème « À la recherche du trésor oublié d'Ibn Battuta ». 4 équipes tangéroises étaient invitées à représenter leurs établissements respectifs.
Récap.
date: 2015-04-25
coverImage: "../../assets/images/photos/blog/enigma/01-Enigma-v1.jpg"
tags: []
@ -8,8 +11,6 @@ featured: true
draft: false
---
# Enigma
Enigma était une chasse au trésor inter-écoles organisée ce samedi par le [CESIM](https://ecolesuperieure.ma/ecole/cesim/), sur le thème « À la recherche du trésor oublié d'Ibn Battuta ». 4 équipes tangéroises étaient invitées à représenter leurs établissements respectifs.
Série artistique en noir et blanc
**40 photos**
Récap.

View file

@ -7,7 +7,7 @@ import Lightbox from '../../../components/photo/Lightbox.astro';
import { getCollection } from 'astro:content';
// Importer toutes les images du dossier photos
const allImages = import.meta.glob<{ default: ImageMetadata }>('/src/assets/images/photos/**/*.{jpg,jpeg,png,webp}');
const allImages = import.meta.glob<{ default: ImageMetadata }>('/src/assets/images/photos/blog/**/*.{jpg,jpeg,png,webp}');
export async function getStaticPaths() {
const allPhotoBlogPosts = await getCollection('photoBlogPosts');
@ -23,8 +23,11 @@ const { Content } = await post.render();
// coverImage est déjà un ImageMetadata grâce au schema image() dans config.ts
const coverImage = post.data.coverImage;
// Slug de base sans suffixe de langue (enigma.en → enigma)
const baseSlug = post.slug.replace(/\.(en|ar)$/, '');
// Charger toutes les images du dossier correspondant au slug
const albumPath = `/src/assets/images/photos/blog/${post.slug}/`;
const albumPath = `/src/assets/images/photos/blog/${baseSlug}/`;
const albumImages = Object.keys(allImages)
.filter(path => path.startsWith(albumPath))
.sort();

View file

@ -4,8 +4,9 @@ import CategoryNav from '../../../components/photo/CategoryNav.astro';
import { getCollection } from 'astro:content';
import { Picture } from 'astro:assets';
// Récupération des posts photo
const allPhotoBlogPosts = await getCollection('photoBlogPosts');
// Récupération des posts photo (langue par défaut : FR)
const allPhotoBlogPosts = (await getCollection('photoBlogPosts'))
.filter(post => (post.data.lang ?? 'fr') === 'fr');
// Tri par date (plus récent en premier)
const sortedPosts = allPhotoBlogPosts.sort((a, b) =>