diff --git a/src/content/photoBlogPosts/enigma.ar.md b/src/content/photoBlogPosts/enigma.ar.md new file mode 100644 index 0000000..075c2ff --- /dev/null +++ b/src/content/photoBlogPosts/enigma.ar.md @@ -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 فرق طنجاوية دُعيت لتمثيل مؤسساتها. + +تغطية. diff --git a/src/content/photoBlogPosts/enigma.en.md b/src/content/photoBlogPosts/enigma.en.md new file mode 100644 index 0000000..e8b4375 --- /dev/null +++ b/src/content/photoBlogPosts/enigma.en.md @@ -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. diff --git a/src/content/photoBlogPosts/enigma.md b/src/content/photoBlogPosts/enigma.md index 9f2c9ae..8d8cc9a 100644 --- a/src/content/photoBlogPosts/enigma.md +++ b/src/content/photoBlogPosts/enigma.md @@ -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. diff --git a/src/pages/photo/blog/[slug].astro b/src/pages/photo/blog/[slug].astro index 0190d1d..ac19ad2 100644 --- a/src/pages/photo/blog/[slug].astro +++ b/src/pages/photo/blog/[slug].astro @@ -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(); diff --git a/src/pages/photo/blog/index.astro b/src/pages/photo/blog/index.astro index 71c777d..23cea87 100644 --- a/src/pages/photo/blog/index.astro +++ b/src/pages/photo/blog/index.astro @@ -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) =>