Skip to content

Commit 40fbc44

Browse files
authored
feat: add last meetup and static paths (#524)
1 parent 397d646 commit 40fbc44

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

app/evenements-precedents/[year]/page.tsx

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { H1 } from '../../../modules/atoms/remark/Titles';
22
import React from 'react';
33
import { Metadata } from 'next';
44
import { PastEvents } from './pastEvents';
5+
import { fetchPastEvents } from '../../../modules/meetup/queries/past-events.api';
6+
import _uniq from 'lodash/uniq';
57

68
export const revalidate = 3600;
79
const DEFAULT_YEAR = `${new Date().getFullYear()}`;
@@ -35,3 +37,15 @@ export async function generateMetadata({ params }: { params: Promise<{ year?: st
3537
},
3638
};
3739
}
40+
41+
export async function generateStaticParams() {
42+
const allPastEvents = await fetchPastEvents();
43+
const yearsFromEvents: string[] = allPastEvents
44+
.map((event) => new Date(event.dateTime).getFullYear())
45+
.map((year) => year.toString());
46+
const years = _uniq(yearsFromEvents);
47+
48+
return years.map((year) => ({
49+
year,
50+
}));
51+
}

data/data-override.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import {
33
axopen,
44
bedrock,
55
CBTW,
6+
fulll,
67
indy,
78
leWagon,
89
malt,
@@ -15,6 +16,32 @@ import {
1516
} from './sponsors';
1617

1718
export const dataOverride: { [key: string]: Partial<Event> } = {
19+
'https://www.meetup.com/lyonjs/events/306992187': {
20+
sponsor: fulll,
21+
talks: [
22+
{
23+
title: 'Refondre sans tout casser : notre migration vers une architecture microfrontend',
24+
speakers: [
25+
{
26+
name: 'Nicolas Lefebvre',
27+
},
28+
{
29+
name: 'Maël Martin',
30+
socialLink: 'https://www.linkedin.com/in/maelmartin/',
31+
},
32+
],
33+
},
34+
{
35+
title: 'Rendre ses API idempotentes avec NestJS',
36+
speakers: [
37+
{
38+
name: 'Johann Pardanaud',
39+
socialLink: 'https://www.linkedin.com/in/johann-pardanaud/',
40+
},
41+
],
42+
},
43+
],
44+
},
1845
'https://www.meetup.com/lyonjs/events/306419959': {
1946
sponsor: axopen,
2047
talks: [

0 commit comments

Comments
 (0)