Compare commits
3 commits
50e184be3c
...
d3b32228db
| Author | SHA1 | Date | |
|---|---|---|---|
| d3b32228db | |||
| 1c2f21363e | |||
| b9992ead61 |
7 changed files with 55 additions and 16 deletions
|
|
@ -15,20 +15,19 @@ const postsLoop = allPosts.slice(0, count).map((post) => {
|
||||||
{
|
{
|
||||||
postsLoop.map((post) => {
|
postsLoop.map((post) => {
|
||||||
return (
|
return (
|
||||||
<div
|
<a
|
||||||
class="relative border border-transparent border-dashed cursor-pointer p-7 group rounded-2xl"
|
href={post.link}
|
||||||
onclick={`location.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-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="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">
|
<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">
|
<h2 class="flex items-center mb-3">
|
||||||
<a
|
<span
|
||||||
href={post.link}
|
|
||||||
class="text-xl font-bold leading-tight tracking-tight sm:text-2xl dark:text-neutral-100"
|
class="text-xl font-bold leading-tight tracking-tight sm:text-2xl dark:text-neutral-100"
|
||||||
>
|
>
|
||||||
{post.title}
|
{post.title}
|
||||||
</a>
|
</span>
|
||||||
<svg
|
<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"
|
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"
|
viewBox="0 0 13 15"
|
||||||
|
|
@ -76,7 +75,7 @@ const postsLoop = allPosts.slice(0, count).map((post) => {
|
||||||
Posted on {post.dateFormatted}
|
Posted on {post.dateFormatted}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</a>
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,7 @@ const photoBlogPostsCollection = defineCollection({
|
||||||
tags: z.array(z.string()).optional(),
|
tags: z.array(z.string()).optional(),
|
||||||
featured: z.boolean().default(false),
|
featured: z.boolean().default(false),
|
||||||
draft: z.boolean().default(false),
|
draft: z.boolean().default(false),
|
||||||
|
lang: z.enum(['fr', 'en', 'ar']).default('fr'),
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
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"
|
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
|
date: 2015-04-25
|
||||||
coverImage: "../../assets/images/photos/blog/enigma/01-Enigma-v1.jpg"
|
coverImage: "../../assets/images/photos/blog/enigma/01-Enigma-v1.jpg"
|
||||||
tags: []
|
tags: []
|
||||||
|
|
@ -8,8 +11,6 @@ featured: true
|
||||||
draft: false
|
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
|
Récap.
|
||||||
|
|
||||||
**40 photos**
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import Lightbox from '../../../components/photo/Lightbox.astro';
|
||||||
import { getCollection } from 'astro:content';
|
import { getCollection } from 'astro:content';
|
||||||
|
|
||||||
// Importer toutes les images du dossier photos
|
// 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() {
|
export async function getStaticPaths() {
|
||||||
const allPhotoBlogPosts = await getCollection('photoBlogPosts');
|
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
|
// coverImage est déjà un ImageMetadata grâce au schema image() dans config.ts
|
||||||
const coverImage = post.data.coverImage;
|
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
|
// 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)
|
const albumImages = Object.keys(allImages)
|
||||||
.filter(path => path.startsWith(albumPath))
|
.filter(path => path.startsWith(albumPath))
|
||||||
.sort();
|
.sort();
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,9 @@ import CategoryNav from '../../../components/photo/CategoryNav.astro';
|
||||||
import { getCollection } from 'astro:content';
|
import { getCollection } from 'astro:content';
|
||||||
import { Picture } from 'astro:assets';
|
import { Picture } from 'astro:assets';
|
||||||
|
|
||||||
// Récupération des posts photo
|
// Récupération des posts photo (langue par défaut : FR)
|
||||||
const allPhotoBlogPosts = await getCollection('photoBlogPosts');
|
const allPhotoBlogPosts = (await getCollection('photoBlogPosts'))
|
||||||
|
.filter(post => (post.data.lang ?? 'fr') === 'fr');
|
||||||
|
|
||||||
// Tri par date (plus récent en premier)
|
// Tri par date (plus récent en premier)
|
||||||
const sortedPosts = allPhotoBlogPosts.sort((a, b) =>
|
const sortedPosts = allPhotoBlogPosts.sort((a, b) =>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue