Skip to content

Commit b9e092b

Browse files
committed
feat: add paper infos before abstract to items in research page
1 parent 85a54bf commit b9e092b

File tree

6 files changed

+25
-17
lines changed

6 files changed

+25
-17
lines changed

assets/scss/globals/_global.scss

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,3 +179,15 @@ body {
179179
flex: 1 1 auto;
180180
}
181181
}
182+
183+
.paper-info {
184+
> div,
185+
p {
186+
margin: 0;
187+
margin-bottom: 0.5vw;
188+
}
189+
190+
strong {
191+
font-weight: bold;
192+
}
193+
}

bun.lockb

32 Bytes
Binary file not shown.

content.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ export default defineContentConfig({
2727
cta: z.string().optional(),
2828
date: z.string().optional(),
2929
type: z.string(),
30+
infos: z.array(z.object({
31+
info: z.string(),
32+
})).optional(),
3033
}),
3134
}),
3235
source: 'research/*.md',

nuxt.config.ts

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
// https://nuxt.com/docs/api/configuration/nuxt-config
22
export default defineNuxtConfig({
3-
modules: [
4-
'@nuxt/content',
5-
'motion-v/nuxt',
6-
'nuxt-gtag',
7-
'@nuxtjs/sitemap',
8-
'@nuxt/fonts',
9-
'@nuxt/image',
10-
'@nuxt/eslint',
11-
],
3+
modules: ['@nuxt/content', 'motion-v/nuxt', 'nuxt-gtag', '@nuxtjs/sitemap', '@nuxt/fonts', '@nuxt/image', '@nuxt/eslint', '@nuxtjs/mdc'],
124
devtools: { enabled: true },
135
app: {
146
head: {
@@ -73,4 +65,4 @@ export default defineNuxtConfig({
7365
},
7466
},
7567
},
76-
})
68+
})

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
"dependencies": {
1515
"@nuxt/eslint": "1.0.1",
1616
"@nuxt/image": "1.9.0",
17+
"@nuxtjs/mdc": "0.13.5",
1718
"@nuxtjs/sitemap": "7.2.2",
1819
"eslint": "^9.0.0",
1920
"nuxt": "^3.15.2",

pages/research.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,15 @@
6060
link.label }}</a>
6161
</div>
6262
</div>
63-
<!-- NEW SUBSECTION START -->
64-
<div class="pre-abstract" v-if="res.meta.infos && res.meta.infos.length">
63+
<div class="paper-infos copy small" v-if="res.meta.infos && res.meta.infos.length">
6564
<div
6665
v-for="info in res.meta.infos"
6766
:key="info.info"
68-
class="info"
67+
class="paper-info"
6968
>
70-
<!-- <ContentRendererMarkdown :value="item.info" /> -->
71-
{{ info.info }}
69+
<MDC :value="info.info" tag="div" />
7270
</div>
7371
</div>
74-
<!-- NEW SUBSECTION END -->
7572
<div class="copy small">
7673
<ContentRenderer :value="res" />
7774
</div>
@@ -92,10 +89,13 @@ import anime from 'animejs'
9289
9390
const { data: research } = await useAsyncData('research', async () => {
9491
const qCollection = await queryCollection('research').all()
92+
const typeOrder = ['Publications', 'Working Papers', 'Work in Progress']
9593
return qCollection.sort((a, b) => {
9694
const dateA = new Date(a.meta.date ?? '1970-01-01')
9795
const dateB = new Date(b.meta.date ?? '1970-01-01')
98-
96+
if (a.meta.type !== b.meta.type) {
97+
return typeOrder.indexOf(a.meta.type) - typeOrder.indexOf(b.meta.type)
98+
}
9999
return dateB.getTime() - dateA.getTime()
100100
}).reduce((acc: Record<string, ResearchCollectionItem[]>, v) => {
101101
acc[v.meta.type] ??= []

0 commit comments

Comments
 (0)