11<template >
22 <div >
3- <PageTitle >Research</PageTitle >
43 <div class =" fl-column aself-start standard-padding" >
5- <Motion
6- v-for =" (res) in research"
7- :key =" res.title"
8- class =" publication"
9- :initial =" { opacity: 0, y: 30 }"
10- :in-view =" { opacity: 1, y: 0 }"
11- :in-view-options =" { once: true, amount: 'some' }"
12- :transition =" { duration: 0.9 }"
4+ <div
5+ v-for =" ([resType, resArr]) in Object.entries(research!)"
6+ :key =" resType"
137 >
14- <div class =" title-container" >
15- <component
16- :is =" res.meta.title_link ? 'a' : 'div'"
17- :href =" res.meta.title_link ? res.meta.title_link : null"
18- class =" title small"
19- >
20- {{ res.title }}
21- </component >
22- <div
23- v-if =" res.meta.coauthors"
24- class =" coauthors copy small"
25- >
26- with
27- <span
28- v-for =" (c, index) in res.meta.coauthors"
29- :key =" c.coauthor.name"
30- class =" coauthor"
8+ <PageTitle style =" margin-left : 0 ; padding-left : 0 ;" >
9+ {{ resType }}
10+ </PageTitle >
11+ <Motion
12+ v-for =" (res) in resArr"
13+ :key =" res.title"
14+ class =" publication"
15+ :initial =" { opacity: 0, y: 30 }"
16+ :in-view =" { opacity: 1, y: 0 }"
17+ :in-view-options =" { once: true, amount: 'some' }"
18+ :transition =" { duration: 0.9 }"
19+ >
20+ <div class =" title-container" >
21+ <component
22+ :is =" res.meta.title_link ? 'a' : 'div'"
23+ :href =" res.meta.title_link ? res.meta.title_link : null"
24+ class =" title small"
25+ >
26+ {{ res.title }}
27+ </component >
28+ <div
29+ v-if =" res.meta.coauthors"
30+ class =" coauthors copy small"
31+ >
32+ with
33+ <span
34+ v-for =" (c, index) in res.meta.coauthors"
35+ :key =" c.coauthor.name"
36+ class =" coauthor"
37+ >
38+ <a
39+ v-if =" c.coauthor.link"
40+ :href =" c.coauthor.link"
41+ >{{ c.coauthor.name }}</a >
42+ <span v-else >{{ c.coauthor.name }}</span >{{ getLigature(res.meta.coauthors, index) }}
43+ </span >
44+ </div >
45+ <div
46+ v-if =" res.meta.links && res.meta.links.length"
47+ ref =" links"
48+ class =" links"
3149 >
3250 <a
33- v-if =" c.coauthor.link"
34- :href =" c.coauthor.link"
35- >{{ c.coauthor.name }}</a >
36- <span v-else >{{ c.coauthor.name }}</span >{{ getLigature(res.meta.coauthors, index) }}
37- </span >
51+ v-for =" link in res.meta.links"
52+ :key =" link.link"
53+ class =" link"
54+ target =" _blank"
55+ :href =" link.link"
56+ >{{
57+ link.label }}</a >
58+ </div >
3859 </div >
39- <div
40- v-if =" res.meta.links && res.meta.links.length"
41- ref =" links"
42- class =" links"
43- >
44- <a
45- v-for =" link in res.meta.links"
46- :key =" link.link"
47- class =" link"
48- target =" _blank"
49- :href =" link.link"
50- >{{
51- link.label }}</a >
60+ <div class =" copy small" >
61+ <ContentRenderer :value =" res" />
5262 </div >
53- </div >
54- <div class =" copy small" >
55- <ContentRenderer :value =" res" />
56- </div >
57- <a
58- v-if =" res.meta.cta"
59- class =" external copy small"
60- :href =" res.meta.cta"
61- >Read Me</a >
62- </Motion >
63+ <a
64+ v-if =" res.meta.cta"
65+ class =" external copy small"
66+ :href =" res.meta.cta"
67+ >Read Me</a >
68+ </Motion >
69+ </div >
6370 </div >
6471 </div >
6572</template >
6673
6774<script setup lang="ts">
75+ import type { ResearchCollectionItem } from ' @nuxt/content'
6876import anime from ' animejs'
6977
7078const { data : research } = await useAsyncData (' research' , async () => {
@@ -74,7 +82,11 @@ const { data: research } = await useAsyncData('research', async () => {
7482 const dateB = new Date (b .meta .date ?? ' 1970-01-01' )
7583
7684 return dateB .getTime () - dateA .getTime ()
77- })
85+ }).reduce ((acc : Record <string , ResearchCollectionItem []>, v ) => {
86+ acc [v .meta .type ] ?? = []
87+ acc [v .meta .type ].push (v )
88+ return acc
89+ }, {})
7890})
7991useHead ({
8092 title: ` Research ` ,
0 commit comments