1
1
---
2
2
import type { GetStaticPaths } from " astro" ;
3
- import { getCollection , getEntry } from " astro:content" ;
3
+ import { getCollection , getEntry , render } from " astro:content" ;
4
4
import Base from " @layouts/base/index.astro" ;
5
5
import BlurImageHeader from " @components/composite/header/BlurImageHeader.astro" ;
6
6
import ResponsiveWidth from " @components/layout/ResponsiveWidth.astro" ;
@@ -11,31 +11,35 @@ import H2 from "@components/composite/heading/h2.astro";
11
11
import VSpace from " @components/layout/VSpace.astro" ;
12
12
import RecentWorks from " @components/pages/teams/RecentWorks.astro" ;
13
13
import { viewRank } from " @content" ;
14
+ import type { CollectionEntry } from " astro:content" ;
14
15
15
16
export const getStaticPaths = (async () => {
16
17
return (await getCollection (" team" )).map ((team ) => ({
17
- params: { slug: team .slug },
18
+ params: { slug: team .id },
18
19
}));
19
20
}) satisfies GetStaticPaths ;
20
21
21
- const team = await getEntry (" team" , Astro .params .slug );
22
+ const team = (await getEntry (
23
+ " team" ,
24
+ Astro .params .slug ,
25
+ )) as CollectionEntry <" team" >;
22
26
23
- const Rendered = await team . render ();
27
+ const Rendered = await render (team );
24
28
25
29
const faculties = await getCollection (
26
30
" member" ,
27
31
(member ) =>
28
32
(member .data .occupation === " Faculty" ||
29
33
member .data .occupation === " Researcher" ) &&
30
- member .data .team .slug === Astro .params .slug ,
34
+ member .data .team .id === Astro .params .slug ,
31
35
);
32
36
33
37
const students = await getCollection (
34
38
" member" ,
35
39
(member ) =>
36
40
(member .data .occupation === " Student" ||
37
41
member .data .occupation === " Research Student" ) &&
38
- member .data .team .slug === Astro .params .slug ,
42
+ member .data .team .id === Astro .params .slug ,
39
43
);
40
44
---
41
45
0 commit comments