diff --git a/src/content/config.ts b/src/content/config.ts index f595e76..5e9346b 100644 --- a/src/content/config.ts +++ b/src/content/config.ts @@ -67,11 +67,11 @@ const talksCollection = defineCollection({ const photoBlogPostsCollection = defineCollection({ type: "content", - schema: ({ image }) => z.object({ + schema: z.object({ title: z.string(), description: z.string(), date: z.date(), - coverImage: image(), + coverImage: z.string(), tags: z.array(z.string()).optional(), featured: z.boolean().default(false), draft: z.boolean().default(false), diff --git a/src/content/photoBlogPosts/eroll.ar.md b/src/content/photoBlogPosts/2011/eroll.ar.md similarity index 82% rename from src/content/photoBlogPosts/eroll.ar.md rename to src/content/photoBlogPosts/2011/eroll.ar.md index da156da..97bc904 100644 --- a/src/content/photoBlogPosts/eroll.ar.md +++ b/src/content/photoBlogPosts/2011/eroll.ar.md @@ -2,7 +2,7 @@ title: "تصوير إيرول" description: "أراد إيرول صورًا له لإعداد كتاب أعمال. عملنا طوال اليوم لتنويع الأجواء..." date: 2011-10-02 -coverImage: "../../assets/images/photos/blog/eroll/18-Eroll-Shooting-1-19.jpg" +coverImage: "18-Eroll-Shooting-1-19.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/eroll.en.md b/src/content/photoBlogPosts/2011/eroll.en.md similarity index 82% rename from src/content/photoBlogPosts/eroll.en.md rename to src/content/photoBlogPosts/2011/eroll.en.md index 07ccf74..5826d40 100644 --- a/src/content/photoBlogPosts/eroll.en.md +++ b/src/content/photoBlogPosts/2011/eroll.en.md @@ -2,7 +2,7 @@ title: "Shooting Eroll" description: "Eroll wanted some photos of him in order to have a modeling book. We worked all day in order to have some ambiance variations..." date: 2011-10-02 -coverImage: "../../assets/images/photos/blog/eroll/18-Eroll-Shooting-1-19.jpg" +coverImage: "18-Eroll-Shooting-1-19.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/eroll.md b/src/content/photoBlogPosts/2011/eroll.md similarity index 81% rename from src/content/photoBlogPosts/eroll.md rename to src/content/photoBlogPosts/2011/eroll.md index c5ba6f1..813d6e8 100644 --- a/src/content/photoBlogPosts/eroll.md +++ b/src/content/photoBlogPosts/2011/eroll.md @@ -2,7 +2,7 @@ title: "Shooting Eroll" description: "Eroll voulait des photos de lui pour constituer un book. On a travaillé toute la journée pour varier les ambiances..." date: 2011-10-02 -coverImage: "../../assets/images/photos/blog/eroll/18-Eroll-Shooting-1-19.jpg" +coverImage: "18-Eroll-Shooting-1-19.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/inox-park-2011.ar.md b/src/content/photoBlogPosts/2011/inox-park-2011.ar.md similarity index 89% rename from src/content/photoBlogPosts/inox-park-2011.ar.md rename to src/content/photoBlogPosts/2011/inox-park-2011.ar.md index 82c38ae..48d1535 100644 --- a/src/content/photoBlogPosts/inox-park-2011.ar.md +++ b/src/content/photoBlogPosts/2011/inox-park-2011.ar.md @@ -2,7 +2,7 @@ title: "Inox Park Paris 2011" description: "بعد نجاحه في 2010، يعود مهرجان Inox Park Paris إلى جزيرة شاتو في نسخته الثانية. ثلاث مسارح، 15 دي جي، 12 ساعة من الحفل في الهواء الطلق: Tiësto، Joachim Garraud، Sven Väth، Steve Aoki..." date: 2011-09-10 -coverImage: "../../assets/images/photos/blog/inox-park-2011/01-Inox-Park-Paris-Chatou-2011.jpg" +coverImage: "01-Inox-Park-Paris-Chatou-2011.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/inox-park-2011.en.md b/src/content/photoBlogPosts/2011/inox-park-2011.en.md similarity index 87% rename from src/content/photoBlogPosts/inox-park-2011.en.md rename to src/content/photoBlogPosts/2011/inox-park-2011.en.md index 254a28b..1b26f7b 100644 --- a/src/content/photoBlogPosts/inox-park-2011.en.md +++ b/src/content/photoBlogPosts/2011/inox-park-2011.en.md @@ -2,7 +2,7 @@ title: "Inox Park Paris 2011" description: "After its 2010 success, the Inox Park Paris Electro Festival is back to the island of Chatou for its second edition. Three stages, 15 DJs, 12 hours of outdoor party: Tiësto, Joachim Garraud, Sven Väth, Steve Aoki..." date: 2011-09-10 -coverImage: "../../assets/images/photos/blog/inox-park-2011/01-Inox-Park-Paris-Chatou-2011.jpg" +coverImage: "01-Inox-Park-Paris-Chatou-2011.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/inox-park-2011.md b/src/content/photoBlogPosts/2011/inox-park-2011.md similarity index 86% rename from src/content/photoBlogPosts/inox-park-2011.md rename to src/content/photoBlogPosts/2011/inox-park-2011.md index 215f498..1cac403 100644 --- a/src/content/photoBlogPosts/inox-park-2011.md +++ b/src/content/photoBlogPosts/2011/inox-park-2011.md @@ -2,7 +2,7 @@ title: "Inox Park Paris 2011" description: "Après son succès de 2010, le festival Inox Park Paris revient sur l'île de Chatou pour sa deuxième édition. Trois scènes, 15 DJs, 12 heures de fête en plein air : Tiësto, Joachim Garraud, Sven Väth, Steve Aoki..." date: 2011-09-10 -coverImage: "../../assets/images/photos/blog/inox-park-2011/10-Inox-Park-Paris-Chatou-2011-7.jpg" +coverImage: "10-Inox-Park-Paris-Chatou-2011-7.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/schoolbag-operation-2012.ar.md b/src/content/photoBlogPosts/2012/schoolbag-operation-2012.ar.md similarity index 80% rename from src/content/photoBlogPosts/schoolbag-operation-2012.ar.md rename to src/content/photoBlogPosts/2012/schoolbag-operation-2012.ar.md index c8f05c0..4c1c11a 100644 --- a/src/content/photoBlogPosts/schoolbag-operation-2012.ar.md +++ b/src/content/photoBlogPosts/2012/schoolbag-operation-2012.ar.md @@ -2,7 +2,7 @@ title: "عملية المحفظة 2012" description: "توزيع محافظ مدرسية مجانية في مدارس محرومة من طرف جمعية محلية (JCI)، طنجة، المغرب." date: 2012-09-30 -coverImage: "../../assets/images/photos/blog/schoolbag-operation-2012/35-Moroccan-Schoolgirls.jpg" +coverImage: "35-Moroccan-Schoolgirls.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/schoolbag-operation-2012.en.md b/src/content/photoBlogPosts/2012/schoolbag-operation-2012.en.md similarity index 77% rename from src/content/photoBlogPosts/schoolbag-operation-2012.en.md rename to src/content/photoBlogPosts/2012/schoolbag-operation-2012.en.md index c124f78..d3c46c9 100644 --- a/src/content/photoBlogPosts/schoolbag-operation-2012.en.md +++ b/src/content/photoBlogPosts/2012/schoolbag-operation-2012.en.md @@ -2,7 +2,7 @@ title: "Schoolbag Operation 2012" description: "During a distribution of free schoolbags in poor schools by a local association (JCI), Tangier, Morocco." date: 2012-09-30 -coverImage: "../../assets/images/photos/blog/schoolbag-operation-2012/35-Moroccan-Schoolgirls.jpg" +coverImage: "35-Moroccan-Schoolgirls.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/schoolbag-operation-2012.md b/src/content/photoBlogPosts/2012/schoolbag-operation-2012.md similarity index 77% rename from src/content/photoBlogPosts/schoolbag-operation-2012.md rename to src/content/photoBlogPosts/2012/schoolbag-operation-2012.md index e7f14b0..deedcb8 100644 --- a/src/content/photoBlogPosts/schoolbag-operation-2012.md +++ b/src/content/photoBlogPosts/2012/schoolbag-operation-2012.md @@ -2,7 +2,7 @@ title: "Opération Cartable 2012" description: "Distribution gratuite de cartables dans des écoles défavorisées par une association locale (JCI), Tanger, Maroc." date: 2012-09-30 -coverImage: "../../assets/images/photos/blog/schoolbag-operation-2012/35-Moroccan-Schoolgirls.jpg" +coverImage: "35-Moroccan-Schoolgirls.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/tangier-walk.ar.md b/src/content/photoBlogPosts/2012/tangier-walk.ar.md similarity index 72% rename from src/content/photoBlogPosts/tangier-walk.ar.md rename to src/content/photoBlogPosts/2012/tangier-walk.ar.md index 121c1cc..2a3de64 100644 --- a/src/content/photoBlogPosts/tangier-walk.ar.md +++ b/src/content/photoBlogPosts/2012/tangier-walk.ar.md @@ -2,7 +2,7 @@ title: "جولة في طنجة" description: "جولة فوتوغرافية في شوارع طنجة." date: 2012-05-26 -coverImage: "../../assets/images/photos/blog/tangier-walk/01-Observer-le-changement.jpg" +coverImage: "01-Observer-le-changement.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/tangier-walk.en.md b/src/content/photoBlogPosts/2012/tangier-walk.en.md similarity index 70% rename from src/content/photoBlogPosts/tangier-walk.en.md rename to src/content/photoBlogPosts/2012/tangier-walk.en.md index 466022f..f183a2b 100644 --- a/src/content/photoBlogPosts/tangier-walk.en.md +++ b/src/content/photoBlogPosts/2012/tangier-walk.en.md @@ -2,7 +2,7 @@ title: "Tangier Walk" description: "A photographic walk through the streets of Tangier." date: 2012-05-26 -coverImage: "../../assets/images/photos/blog/tangier-walk/01-Observer-le-changement.jpg" +coverImage: "01-Observer-le-changement.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/tangier-walk.md b/src/content/photoBlogPosts/2012/tangier-walk.md similarity index 69% rename from src/content/photoBlogPosts/tangier-walk.md rename to src/content/photoBlogPosts/2012/tangier-walk.md index 8ca2044..980ba6d 100644 --- a/src/content/photoBlogPosts/tangier-walk.md +++ b/src/content/photoBlogPosts/2012/tangier-walk.md @@ -2,7 +2,7 @@ title: "Balade à Tanger" description: "Promenade photographique dans les rues de Tanger" date: 2012-05-26 -coverImage: "../../assets/images/photos/blog/tangier-walk/01-Observer-le-changement.jpg" +coverImage: "01-Observer-le-changement.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/helsinki.ar.md b/src/content/photoBlogPosts/2013/helsinki.ar.md similarity index 75% rename from src/content/photoBlogPosts/helsinki.ar.md rename to src/content/photoBlogPosts/2013/helsinki.ar.md index 338fafa..838469a 100644 --- a/src/content/photoBlogPosts/helsinki.ar.md +++ b/src/content/photoBlogPosts/2013/helsinki.ar.md @@ -2,7 +2,7 @@ title: "هلسنكي" description: "اختفى الثلج من هلسنكي وسرعان ما أفسح المجال للربيع..." date: 2013-05-15 -coverImage: "../../assets/images/photos/blog/helsinki/01-Library-of-University-of-Helsinki.jpg" +coverImage: "01-Library-of-University-of-Helsinki.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/helsinki.en.md b/src/content/photoBlogPosts/2013/helsinki.en.md similarity index 72% rename from src/content/photoBlogPosts/helsinki.en.md rename to src/content/photoBlogPosts/2013/helsinki.en.md index 92ba20c..4eae523 100644 --- a/src/content/photoBlogPosts/helsinki.en.md +++ b/src/content/photoBlogPosts/2013/helsinki.en.md @@ -2,7 +2,7 @@ title: "Helsinki" description: "The snow has disappeared from Helsinki and quickly gave way to spring..." date: 2013-05-15 -coverImage: "../../assets/images/photos/blog/helsinki/01-Library-of-University-of-Helsinki.jpg" +coverImage: "01-Library-of-University-of-Helsinki.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/helsinki.md b/src/content/photoBlogPosts/2013/helsinki.md similarity index 71% rename from src/content/photoBlogPosts/helsinki.md rename to src/content/photoBlogPosts/2013/helsinki.md index 6305257..8a19983 100644 --- a/src/content/photoBlogPosts/helsinki.md +++ b/src/content/photoBlogPosts/2013/helsinki.md @@ -2,7 +2,7 @@ title: "Helsinki" description: "La neige a disparu d'Helsinki et a vite laissé place au printemps..." date: 2013-05-15 -coverImage: "../../assets/images/photos/blog/helsinki/01-Library-of-University-of-Helsinki.jpg" +coverImage: "01-Library-of-University-of-Helsinki.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/ifrane-hike.ar.md b/src/content/photoBlogPosts/2013/ifrane-hike.ar.md similarity index 78% rename from src/content/photoBlogPosts/ifrane-hike.ar.md rename to src/content/photoBlogPosts/2013/ifrane-hike.ar.md index 7278a00..9654570 100644 --- a/src/content/photoBlogPosts/ifrane-hike.ar.md +++ b/src/content/photoBlogPosts/2013/ifrane-hike.ar.md @@ -2,7 +2,7 @@ title: "نزهة في إفران" description: "نزهة شتوية في جبال الأطلس المتوسط." date: 2013-01-13 -coverImage: "../../assets/images/photos/blog/ifrane-hike/03-3.jpg" +coverImage: "03-3.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/ifrane-hike.en.md b/src/content/photoBlogPosts/2013/ifrane-hike.en.md similarity index 74% rename from src/content/photoBlogPosts/ifrane-hike.en.md rename to src/content/photoBlogPosts/2013/ifrane-hike.en.md index 1b30df9..a98ec48 100644 --- a/src/content/photoBlogPosts/ifrane-hike.en.md +++ b/src/content/photoBlogPosts/2013/ifrane-hike.en.md @@ -2,7 +2,7 @@ title: "Ifrane Hike" description: "Winter hike in the Middle Atlas mountains." date: 2013-01-13 -coverImage: "../../assets/images/photos/blog/ifrane-hike/03-3.jpg" +coverImage: "03-3.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/ifrane-hike.md b/src/content/photoBlogPosts/2013/ifrane-hike.md similarity index 76% rename from src/content/photoBlogPosts/ifrane-hike.md rename to src/content/photoBlogPosts/2013/ifrane-hike.md index 87056c8..e74790a 100644 --- a/src/content/photoBlogPosts/ifrane-hike.md +++ b/src/content/photoBlogPosts/2013/ifrane-hike.md @@ -2,7 +2,7 @@ title: "Randonnée à Ifrane" description: "Randonnée hivernale dans les montagnes du Moyen Atlas" date: 2013-01-13 -coverImage: "../../assets/images/photos/blog/ifrane-hike/03-3.jpg" +coverImage: "03-3.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/london-calling.ar.md b/src/content/photoBlogPosts/2014/london-calling.ar.md similarity index 74% rename from src/content/photoBlogPosts/london-calling.ar.md rename to src/content/photoBlogPosts/2014/london-calling.ar.md index a6f1f19..fa28e16 100644 --- a/src/content/photoBlogPosts/london-calling.ar.md +++ b/src/content/photoBlogPosts/2014/london-calling.ar.md @@ -2,7 +2,7 @@ title: "London Calling" description: "عطلة نهاية أسبوع فوتوغرافية في لندن." date: 2014-07-15 -coverImage: "../../assets/images/photos/blog/london-calling/01-The-sky-inside.jpg" +coverImage: "01-The-sky-inside.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/london-calling.en.md b/src/content/photoBlogPosts/2014/london-calling.en.md similarity index 68% rename from src/content/photoBlogPosts/london-calling.en.md rename to src/content/photoBlogPosts/2014/london-calling.en.md index 6b231b7..2bb25f0 100644 --- a/src/content/photoBlogPosts/london-calling.en.md +++ b/src/content/photoBlogPosts/2014/london-calling.en.md @@ -2,7 +2,7 @@ title: "London Calling" description: "A photographic weekend in London." date: 2014-07-15 -coverImage: "../../assets/images/photos/blog/london-calling/01-The-sky-inside.jpg" +coverImage: "01-The-sky-inside.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/london-calling.md b/src/content/photoBlogPosts/2014/london-calling.md similarity index 67% rename from src/content/photoBlogPosts/london-calling.md rename to src/content/photoBlogPosts/2014/london-calling.md index 53e9164..ae4b53f 100644 --- a/src/content/photoBlogPosts/london-calling.md +++ b/src/content/photoBlogPosts/2014/london-calling.md @@ -2,7 +2,7 @@ title: "London Calling" description: "Week-end photographique à Londres" date: 2014-07-15 -coverImage: "../../assets/images/photos/blog/london-calling/01-The-sky-inside.jpg" +coverImage: "01-The-sky-inside.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/sequanian-sunday.ar.md b/src/content/photoBlogPosts/2014/sequanian-sunday.ar.md similarity index 68% rename from src/content/photoBlogPosts/sequanian-sunday.ar.md rename to src/content/photoBlogPosts/2014/sequanian-sunday.ar.md index 2fcdff3..6b468c3 100644 --- a/src/content/photoBlogPosts/sequanian-sunday.ar.md +++ b/src/content/photoBlogPosts/2014/sequanian-sunday.ar.md @@ -2,7 +2,7 @@ title: "أحد سيكواني" description: "نزهة يوم أحد على ضفاف نهر السين." date: 2014-05-18 -coverImage: "../../assets/images/photos/blog/sequanian-sunday/04-La-Defense-seen-from-Pont-de-Suresnes-2.jpg" +coverImage: "04-La-Defense-seen-from-Pont-de-Suresnes-2.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/sequanian-sunday.en.md b/src/content/photoBlogPosts/2014/sequanian-sunday.en.md similarity index 61% rename from src/content/photoBlogPosts/sequanian-sunday.en.md rename to src/content/photoBlogPosts/2014/sequanian-sunday.en.md index b9bbb8e..a2255c3 100644 --- a/src/content/photoBlogPosts/sequanian-sunday.en.md +++ b/src/content/photoBlogPosts/2014/sequanian-sunday.en.md @@ -2,7 +2,7 @@ title: "Sequanian Sunday" description: "A sunday walk near the Seine." date: 2014-05-18 -coverImage: "../../assets/images/photos/blog/sequanian-sunday/04-La-Defense-seen-from-Pont-de-Suresnes-2.jpg" +coverImage: "04-La-Defense-seen-from-Pont-de-Suresnes-2.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/sequanian-sunday.md b/src/content/photoBlogPosts/2014/sequanian-sunday.md similarity index 62% rename from src/content/photoBlogPosts/sequanian-sunday.md rename to src/content/photoBlogPosts/2014/sequanian-sunday.md index 936d62c..a3dc6c3 100644 --- a/src/content/photoBlogPosts/sequanian-sunday.md +++ b/src/content/photoBlogPosts/2014/sequanian-sunday.md @@ -2,7 +2,7 @@ title: "Dimanche Séquanais" description: "Balade dominicale au bord de la Seine." date: 2014-05-18 -coverImage: "../../assets/images/photos/blog/sequanian-sunday/04-La-Defense-seen-from-Pont-de-Suresnes-2.jpg" +coverImage: "04-La-Defense-seen-from-Pont-de-Suresnes-2.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/wandering-tangier-medina.ar.md b/src/content/photoBlogPosts/2014/wandering-tangier-medina.ar.md similarity index 82% rename from src/content/photoBlogPosts/wandering-tangier-medina.ar.md rename to src/content/photoBlogPosts/2014/wandering-tangier-medina.ar.md index c8dc49e..c14ca9e 100644 --- a/src/content/photoBlogPosts/wandering-tangier-medina.ar.md +++ b/src/content/photoBlogPosts/2014/wandering-tangier-medina.ar.md @@ -2,7 +2,7 @@ title: "تجوال في مدينة طنجة القديمة" description: "أثناء التجوال في أزقة طنجة القديمة، صادفت ساعاتيًا، ونجّارًا، وقمرًا عملاقًا..." date: 2014-08-10 -coverImage: "../../assets/images/photos/blog/wandering-tangier-medina/01-The-watchmaker.jpg" +coverImage: "01-The-watchmaker.jpg" tags: [] featured: true draft: false diff --git a/src/content/photoBlogPosts/wandering-tangier-medina.en.md b/src/content/photoBlogPosts/2014/wandering-tangier-medina.en.md similarity index 76% rename from src/content/photoBlogPosts/wandering-tangier-medina.en.md rename to src/content/photoBlogPosts/2014/wandering-tangier-medina.en.md index c27e33f..c71ad87 100644 --- a/src/content/photoBlogPosts/wandering-tangier-medina.en.md +++ b/src/content/photoBlogPosts/2014/wandering-tangier-medina.en.md @@ -2,7 +2,7 @@ title: "Wandering Tangier Medina" description: "Walking in the streets of the old Tangier, met a watchmaker, a carpenter and a super-moon..." date: 2014-08-10 -coverImage: "../../assets/images/photos/blog/wandering-tangier-medina/01-The-watchmaker.jpg" +coverImage: "01-The-watchmaker.jpg" tags: [] featured: true draft: false diff --git a/src/content/photoBlogPosts/wandering-tangier-medina.md b/src/content/photoBlogPosts/2014/wandering-tangier-medina.md similarity index 77% rename from src/content/photoBlogPosts/wandering-tangier-medina.md rename to src/content/photoBlogPosts/2014/wandering-tangier-medina.md index ef226e7..abf23e2 100644 --- a/src/content/photoBlogPosts/wandering-tangier-medina.md +++ b/src/content/photoBlogPosts/2014/wandering-tangier-medina.md @@ -2,7 +2,7 @@ title: "Dans la médina de Tanger" description: "En marchant dans les rues du vieux Tanger, j'ai croisé un horloger, un menuisier et une super-lune..." date: 2014-08-10 -coverImage: "../../assets/images/photos/blog/wandering-tangier-medina/01-The-watchmaker.jpg" +coverImage: "01-The-watchmaker.jpg" tags: [] featured: true draft: false diff --git a/src/content/photoBlogPosts/enigma.ar.md b/src/content/photoBlogPosts/2015/enigma.ar.md similarity index 91% rename from src/content/photoBlogPosts/enigma.ar.md rename to src/content/photoBlogPosts/2015/enigma.ar.md index e81dbf6..ccc9ccf 100644 --- a/src/content/photoBlogPosts/enigma.ar.md +++ b/src/content/photoBlogPosts/2015/enigma.ar.md @@ -5,7 +5,7 @@ description: | تغطية. date: 2015-04-25 -coverImage: "../../assets/images/photos/blog/enigma/01-Enigma-v1.jpg" +coverImage: "01-Enigma-v1.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/enigma.en.md b/src/content/photoBlogPosts/2015/enigma.en.md similarity index 89% rename from src/content/photoBlogPosts/enigma.en.md rename to src/content/photoBlogPosts/2015/enigma.en.md index a82de15..143522d 100644 --- a/src/content/photoBlogPosts/enigma.en.md +++ b/src/content/photoBlogPosts/2015/enigma.en.md @@ -5,7 +5,7 @@ description: | Recap. date: 2015-04-25 -coverImage: "../../assets/images/photos/blog/enigma/01-Enigma-v1.jpg" +coverImage: "01-Enigma-v1.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/enigma.md b/src/content/photoBlogPosts/2015/enigma.md similarity index 89% rename from src/content/photoBlogPosts/enigma.md rename to src/content/photoBlogPosts/2015/enigma.md index 3692331..e68595d 100644 --- a/src/content/photoBlogPosts/enigma.md +++ b/src/content/photoBlogPosts/2015/enigma.md @@ -5,7 +5,7 @@ description: | Récap. date: 2015-04-25 -coverImage: "../../assets/images/photos/blog/enigma/11-Enigma-v1-11.jpg" +coverImage: "11-Enigma-v1-11.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/field-of-stones.ar.md b/src/content/photoBlogPosts/2015/field-of-stones.ar.md similarity index 89% rename from src/content/photoBlogPosts/field-of-stones.ar.md rename to src/content/photoBlogPosts/2015/field-of-stones.ar.md index f490484..8c2e424 100644 --- a/src/content/photoBlogPosts/field-of-stones.ar.md +++ b/src/content/photoBlogPosts/2015/field-of-stones.ar.md @@ -2,7 +2,7 @@ title: "Field of Stones" description: "كواليس تصوير غلاف ألبوم ماركو وولتر. أراد أن تُلتقط الصورة في سينماتيك طنجة. لا وقت، لا إضاءة، لكن لا خيار. حاولنا تقديم أفضل ما لدينا..." date: 2015-04-02 -coverImage: "../../assets/images/photos/blog/field-of-stones/01-Marco-Wolter-Field-of-Stones-2.jpg" +coverImage: "01-Marco-Wolter-Field-of-Stones-2.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/field-of-stones.en.md b/src/content/photoBlogPosts/2015/field-of-stones.en.md similarity index 87% rename from src/content/photoBlogPosts/field-of-stones.en.md rename to src/content/photoBlogPosts/2015/field-of-stones.en.md index 6391406..9a43434 100644 --- a/src/content/photoBlogPosts/field-of-stones.en.md +++ b/src/content/photoBlogPosts/2015/field-of-stones.en.md @@ -2,7 +2,7 @@ title: "Field of Stones" description: "Making of the album cover for Marco Wolter. He wanted it to be shot in the Cinémathèque of Tangier. We had no time, no light, but no choice. We tried to make the best of it..." date: 2015-04-02 -coverImage: "../../assets/images/photos/blog/field-of-stones/01-Marco-Wolter-Field-of-Stones-2.jpg" +coverImage: "01-Marco-Wolter-Field-of-Stones-2.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/field-of-stones.md b/src/content/photoBlogPosts/2015/field-of-stones.md similarity index 87% rename from src/content/photoBlogPosts/field-of-stones.md rename to src/content/photoBlogPosts/2015/field-of-stones.md index 297a9ea..530a4f2 100644 --- a/src/content/photoBlogPosts/field-of-stones.md +++ b/src/content/photoBlogPosts/2015/field-of-stones.md @@ -2,7 +2,7 @@ title: "Field of Stones" description: "Making of de la pochette de l'album de Marco Wolter. Il voulait que la photo soit prise à la Cinémathèque de Tanger. Pas de temps, pas de lumière, mais pas le choix. On a fait au mieux..." date: 2015-04-02 -coverImage: "../../assets/images/photos/blog/field-of-stones/01-Marco-Wolter-Field-of-Stones-2.jpg" +coverImage: "01-Marco-Wolter-Field-of-Stones-2.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/no-wind-las-cuevas.ar.md b/src/content/photoBlogPosts/2015/no-wind-las-cuevas.ar.md similarity index 87% rename from src/content/photoBlogPosts/no-wind-las-cuevas.ar.md rename to src/content/photoBlogPosts/2015/no-wind-las-cuevas.ar.md index c625c97..84fa318 100644 --- a/src/content/photoBlogPosts/no-wind-las-cuevas.ar.md +++ b/src/content/photoBlogPosts/2015/no-wind-las-cuevas.ar.md @@ -2,7 +2,7 @@ title: "لا رياح في لاس كويفاس" description: "كان من المفترض أن يكون يومًا مثاليًا لتطيير طائرتنا الورقية: مشمس وعاصف. مشمس كان، لكن الرياح لم تأتِ أبدًا." date: 2015-01-10 -coverImage: "../../assets/images/photos/blog/no-wind-las-cuevas/13-No-wind-at-Las-Cuevas.jpg" +coverImage: "13-No-wind-at-Las-Cuevas.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/no-wind-las-cuevas.en.md b/src/content/photoBlogPosts/2015/no-wind-las-cuevas.en.md similarity index 82% rename from src/content/photoBlogPosts/no-wind-las-cuevas.en.md rename to src/content/photoBlogPosts/2015/no-wind-las-cuevas.en.md index 2df340c..370c88f 100644 --- a/src/content/photoBlogPosts/no-wind-las-cuevas.en.md +++ b/src/content/photoBlogPosts/2015/no-wind-las-cuevas.en.md @@ -2,7 +2,7 @@ title: "No Wind at Las Cuevas" description: "It was supposed to be a perfect day for flying our kite: sunny and windy. Sunny it was, but the wind never came." date: 2015-01-10 -coverImage: "../../assets/images/photos/blog/no-wind-las-cuevas/13-No-wind-at-Las-Cuevas.jpg" +coverImage: "13-No-wind-at-Las-Cuevas.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/no-wind-las-cuevas.md b/src/content/photoBlogPosts/2015/no-wind-las-cuevas.md similarity index 84% rename from src/content/photoBlogPosts/no-wind-las-cuevas.md rename to src/content/photoBlogPosts/2015/no-wind-las-cuevas.md index 3f1de71..0b0d7b6 100644 --- a/src/content/photoBlogPosts/no-wind-las-cuevas.md +++ b/src/content/photoBlogPosts/2015/no-wind-las-cuevas.md @@ -2,7 +2,7 @@ title: "Pas de vent à Las Cuevas" description: "Ça devait être une journée parfaite pour faire voler notre cerf-volant : ensoleillée et venteuse. Ensoleillée, oui. Mais le vent n'est jamais venu." date: 2015-01-10 -coverImage: "../../assets/images/photos/blog/no-wind-las-cuevas/13-No-wind-at-Las-Cuevas.jpg" +coverImage: "13-No-wind-at-Las-Cuevas.jpg" tags: [] featured: false draft: false diff --git a/src/content/photoBlogPosts/wedding-aurore-thomas.ar.md b/src/content/photoBlogPosts/2015/wedding-aurore-thomas.ar.md similarity index 84% rename from src/content/photoBlogPosts/wedding-aurore-thomas.ar.md rename to src/content/photoBlogPosts/2015/wedding-aurore-thomas.ar.md index de95df5..fa00e71 100644 --- a/src/content/photoBlogPosts/wedding-aurore-thomas.ar.md +++ b/src/content/photoBlogPosts/2015/wedding-aurore-thomas.ar.md @@ -2,7 +2,7 @@ title: "زفاف أورور وتوما" description: "كان لي شرف ومتعة أن أكون شاهد توما في زفافه الجميل مع أورور. ليس سهلًا التصوير في نفس الوقت، لكن كل الصور مليئة بالحب." date: 2015-09-26 -coverImage: "../../assets/images/photos/blog/wedding-aurore-thomas/10-Mariage-Aurore-Thomas-10.jpg" +coverImage: "10-Mariage-Aurore-Thomas-10.jpg" tags: [] featured: true draft: false diff --git a/src/content/photoBlogPosts/wedding-aurore-thomas.en.md b/src/content/photoBlogPosts/2015/wedding-aurore-thomas.en.md similarity index 81% rename from src/content/photoBlogPosts/wedding-aurore-thomas.en.md rename to src/content/photoBlogPosts/2015/wedding-aurore-thomas.en.md index 054ff86..5300588 100644 --- a/src/content/photoBlogPosts/wedding-aurore-thomas.en.md +++ b/src/content/photoBlogPosts/2015/wedding-aurore-thomas.en.md @@ -2,7 +2,7 @@ title: "Wedding Aurore & Thomas" description: "I had the honor and pleasure to be Thomas' best man for his beautiful wedding with Aurore. Not easy to shoot pictures though, but all of them are filled with love." date: 2015-09-26 -coverImage: "../../assets/images/photos/blog/wedding-aurore-thomas/10-Mariage-Aurore-Thomas-10.jpg" +coverImage: "10-Mariage-Aurore-Thomas-10.jpg" tags: [] featured: true draft: false diff --git a/src/content/photoBlogPosts/wedding-aurore-thomas.md b/src/content/photoBlogPosts/2015/wedding-aurore-thomas.md similarity index 82% rename from src/content/photoBlogPosts/wedding-aurore-thomas.md rename to src/content/photoBlogPosts/2015/wedding-aurore-thomas.md index 34ba106..5d8f9f3 100644 --- a/src/content/photoBlogPosts/wedding-aurore-thomas.md +++ b/src/content/photoBlogPosts/2015/wedding-aurore-thomas.md @@ -2,7 +2,7 @@ title: "Mariage Aurore & Thomas" description: "J'ai eu l'honneur et le plaisir d'être le témoin de Thomas pour son beau mariage avec Aurore. Pas facile de shooter en même temps, mais toutes les photos sont remplies d'amour." date: 2015-09-26 -coverImage: "../../assets/images/photos/blog/wedding-aurore-thomas/10-Mariage-Aurore-Thomas-10.jpg" +coverImage: "10-Mariage-Aurore-Thomas-10.jpg" tags: [] featured: true draft: false diff --git a/src/pages/photo/blog/[slug].astro b/src/pages/photo/blog/[year]/[slug].astro similarity index 64% rename from src/pages/photo/blog/[slug].astro rename to src/pages/photo/blog/[year]/[slug].astro index ac19ad2..5c60478 100644 --- a/src/pages/photo/blog/[slug].astro +++ b/src/pages/photo/blog/[year]/[slug].astro @@ -1,9 +1,9 @@ --- -import PhotoLayout from '../../../layouts/PhotoLayout.astro'; -import CategoryNav from '../../../components/photo/CategoryNav.astro'; -import AlbumHeader from '../../../components/photo/AlbumHeader.astro'; -import MasonryGallery from '../../../components/photo/MasonryGallery.astro'; -import Lightbox from '../../../components/photo/Lightbox.astro'; +import PhotoLayout from '../../../../layouts/PhotoLayout.astro'; +import CategoryNav from '../../../../components/photo/CategoryNav.astro'; +import AlbumHeader from '../../../../components/photo/AlbumHeader.astro'; +import MasonryGallery from '../../../../components/photo/MasonryGallery.astro'; +import Lightbox from '../../../../components/photo/Lightbox.astro'; import { getCollection } from 'astro:content'; // Importer toutes les images du dossier photos @@ -11,27 +11,37 @@ const allImages = import.meta.glob<{ default: ImageMetadata }>('/src/assets/imag export async function getStaticPaths() { const allPhotoBlogPosts = await getCollection('photoBlogPosts'); - return allPhotoBlogPosts.map(post => ({ - params: { slug: post.slug }, - props: { post }, - })); + return allPhotoBlogPosts.map(post => { + // Le slug Astro inclut le préfixe d'année (ex: "2015/enigma.en") + const slug = post.slug.replace(/^\d{4}\//, ''); + return { + params: { + year: String(post.data.date.getFullYear()), + slug, + }, + props: { post }, + }; + }); } const { post } = Astro.props; 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 préfixe d'année ni suffixe de langue (2015/enigma.en → enigma) +const baseSlug = post.slug.replace(/^\d{4}\//, '').replace(/\.(en|ar)$/, ''); -// 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/${baseSlug}/`; +// Construire le chemin de l'album avec l'année +const year = post.data.date.getFullYear(); +const albumPath = `/src/assets/images/photos/blog/${year}/${baseSlug}/`; const albumImages = Object.keys(allImages) .filter(path => path.startsWith(albumPath)) .sort(); +// Résoudre la cover image depuis le glob +const coverPath = `/src/assets/images/photos/blog/${year}/${baseSlug}/${post.data.coverImage}`; +const coverImageLoader = allImages[coverPath]; +const coverImage = coverImageLoader ? (await coverImageLoader()).default : undefined; + // Résoudre les images de la galerie const galleryImages = await Promise.all( albumImages.map(async (imagePath) => { @@ -115,4 +125,4 @@ const lightboxImages = galleryImages.map(img => ({ border-radius: 8px; margin: 2em 0; } - \ No newline at end of file + diff --git a/src/pages/photo/blog/index.astro b/src/pages/photo/blog/index.astro index c295cb4..aa43126 100644 --- a/src/pages/photo/blog/index.astro +++ b/src/pages/photo/blog/index.astro @@ -4,6 +4,11 @@ import CategoryNav from '../../../components/photo/CategoryNav.astro'; import { getCollection } from 'astro:content'; import { Picture } from 'astro:assets'; +// Importer toutes les images pour résoudre les cover images +const allImages = import.meta.glob<{ default: ImageMetadata }>( + '/src/assets/images/photos/blog/**/*.{jpg,jpeg,png,webp}' +); + // Récupération des posts photo (langue par défaut : FR) const allPhotoBlogPosts = (await getCollection('photoBlogPosts')) .filter(post => (post.data.lang ?? 'fr') === 'fr'); @@ -13,10 +18,14 @@ const sortedPosts = allPhotoBlogPosts.sort((a, b) => new Date(b.data.date).getTime() - new Date(a.data.date).getTime() ); -// coverImage est déjà un ImageMetadata grâce au schema image() dans config.ts -const postsWithImages = sortedPosts.map((post) => ({ - ...post, - resolvedCoverImage: post.data.coverImage +// Résoudre les cover images via le glob +const postsWithImages = await Promise.all(sortedPosts.map(async (post) => { + const year = post.data.date.getFullYear(); + const baseSlug = post.slug.replace(/^\d{4}\//, '').replace(/\.(en|ar)$/, ''); + const coverPath = `/src/assets/images/photos/blog/${year}/${baseSlug}/${post.data.coverImage}`; + const loader = allImages[coverPath]; + const resolvedCoverImage = loader ? (await loader()).default : undefined; + return { ...post, resolvedCoverImage }; })); // Séparer les posts à la une des autres