Traduction EN/AR du post Enigma et support i18n pour le blog photo
This commit is contained in:
parent
1c2f21363e
commit
d3b32228db
5 changed files with 48 additions and 9 deletions
17
src/content/photoBlogPosts/enigma.ar.md
Normal file
17
src/content/photoBlogPosts/enigma.ar.md
Normal 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 فرق طنجاوية دُعيت لتمثيل مؤسساتها.
|
||||
|
||||
تغطية.
|
||||
17
src/content/photoBlogPosts/enigma.en.md
Normal file
17
src/content/photoBlogPosts/enigma.en.md
Normal 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.
|
||||
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
|
|
|
|||
|
|
@ -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) =>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue