Skip to content

Commit 02af52c

Browse files
committed
Add news section
1 parent f5b1330 commit 02af52c

File tree

11 files changed

+193
-112
lines changed

11 files changed

+193
-112
lines changed

.astro/content-modules.mjs

+17-17
Large diffs are not rendered by default.

bun.lockb

128 Bytes
Binary file not shown.

src/assets/news.json

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[
2+
{
3+
"date": "2025-03-13",
4+
"post": "I gave a talk at <a href='https://science.ubc.ca/students/SCIE113'>UBC's first-year seminar in science (SCIE 113)</a>. I talked about the high-level intuition of probabilistic decision-making algorithms and their impacts in making the world a better place."
5+
},
6+
{
7+
"date": "2025-03-13",
8+
"post": "Hello, world! I'm starting this news section!"
9+
}
10+
]

src/components/News.astro

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
import FormattedDate from "./FormattedDate.astro";
3+
4+
const { news } = Astro.props;
5+
---
6+
7+
<li
8+
class='news flex flex-col sm:flex-row sm:gap-x-4 [&_a]:text-blue-600 dark:[&_a]:text-blue-300 [&_q]:basis-full'
9+
>
10+
<!-- TODO: Fix date -->
11+
<FormattedDate class='min-w-[120px] font-bold' date={new Date(news.date)} />
12+
<div set:html={news.post} />
13+
</li>

src/components/blog/PostPreview.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const postDate = post.data.updatedDate ?? post.data.publishDate;
1717
---
1818

1919
<li class='flex flex-col gap-2 sm:flex-row sm:gap-x-4 [&_q]:basis-full'>
20-
<FormattedDate class='min-w-[120px]' date={postDate} />
20+
<FormattedDate class='min-w-[120px] font-bold' date={postDate} />
2121

2222
<Tag>
2323
{post.data.draft && <span class='text-red-500'>(Draft) </span>}

src/components/layout/Header.astro

+33-27
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,19 @@
1414
>
1515

1616
<div
17-
class='flex flex-row items-center justify-start sm:justify-center gap-x-7 pt-3 sm:pt-0'
17+
class='flex flex-row items-center justify-start gap-x-7 pt-3 sm:justify-center sm:pt-0'
1818
>
1919
<a
2020
href='/'
2121
class='flex-none text-[1.05rem] font-semibold hover:text-foreground/75'
2222
aria-label='Nav Menu Item'
23-
>About
23+
>Home
24+
</a>
25+
<a
26+
href='/cv'
27+
class='flex-none text-[1.05rem] font-semibold hover:text-foreground/75'
28+
aria-label='Nav Menu Item'
29+
>CV
2430
</a>
2531
<a
2632
href='/blog'
@@ -36,32 +42,32 @@
3642
</a>
3743

3844
<button
39-
id='toggleDarkMode'
40-
class='relative rounded-md border border-border p-1.5 transition-all hover:bg-border'
45+
id='toggleDarkMode'
46+
class='relative rounded-md border border-border p-1.5 transition-all hover:bg-border'
4147
>
42-
<span class='sr-only'>Dark Theme</span>
43-
<svg
44-
xmlns='http://www.w3.org/2000/svg'
45-
width='32'
46-
height='32'
47-
viewBox='0 0 24 24'
48-
class='h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:hidden dark:-rotate-90 dark:scale-0'
49-
><path
50-
fill='currentColor'
51-
d='M12 15q1.25 0 2.125-.875T15 12q0-1.25-.875-2.125T12 9q-1.25 0-2.125.875T9 12q0 1.25.875 2.125T12 15m0 1q-1.671 0-2.836-1.164T8 12q0-1.671 1.164-2.836T12 8q1.671 0 2.836 1.164T16 12q0 1.671-1.164 2.836T12 16m-7-3.5H1.5v-1H5zm17.5 0H19v-1h3.5zM11.5 5V1.5h1V5zm0 17.5V19h1v3.5zM6.746 7.404l-2.16-2.098l.695-.744l2.111 2.134zM18.72 19.438l-2.117-2.14l.652-.702l2.16 2.098zM16.596 6.746l2.098-2.16l.744.695l-2.134 2.111zM4.562 18.72l2.14-2.117l.663.652l-2.078 2.179zM12 12'
52-
></path></svg
53-
>
54-
<svg
55-
xmlns='http://www.w3.org/2000/svg'
56-
width='32'
57-
height='32'
58-
viewBox='0 0 24 24'
59-
class='hidden h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:block dark:rotate-0 dark:scale-100'
60-
><path
61-
fill='currentColor'
62-
d='M12.058 20q-3.334 0-5.667-2.333Q4.058 15.333 4.058 12q0-3.038 1.98-5.27Q8.02 4.5 10.942 4.097q.081 0 .159.006t.153.017q-.506.706-.801 1.57q-.295.865-.295 1.811q0 2.667 1.866 4.533q1.867 1.867 4.534 1.867q.952 0 1.813-.295q.862-.295 1.548-.801q.012.075.018.153q.005.078.005.158q-.384 2.923-2.615 4.904T12.057 20'
63-
></path></svg
64-
>
48+
<span class='sr-only'>Dark Theme</span>
49+
<svg
50+
xmlns='http://www.w3.org/2000/svg'
51+
width='32'
52+
height='32'
53+
viewBox='0 0 24 24'
54+
class='h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:hidden dark:-rotate-90 dark:scale-0'
55+
><path
56+
fill='currentColor'
57+
d='M12 15q1.25 0 2.125-.875T15 12q0-1.25-.875-2.125T12 9q-1.25 0-2.125.875T9 12q0 1.25.875 2.125T12 15m0 1q-1.671 0-2.836-1.164T8 12q0-1.671 1.164-2.836T12 8q1.671 0 2.836 1.164T16 12q0 1.671-1.164 2.836T12 16m-7-3.5H1.5v-1H5zm17.5 0H19v-1h3.5zM11.5 5V1.5h1V5zm0 17.5V19h1v3.5zM6.746 7.404l-2.16-2.098l.695-.744l2.111 2.134zM18.72 19.438l-2.117-2.14l.652-.702l2.16 2.098zM16.596 6.746l2.098-2.16l.744.695l-2.134 2.111zM4.562 18.72l2.14-2.117l.663.652l-2.078 2.179zM12 12'
58+
></path></svg
59+
>
60+
<svg
61+
xmlns='http://www.w3.org/2000/svg'
62+
width='32'
63+
height='32'
64+
viewBox='0 0 24 24'
65+
class='hidden h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:block dark:rotate-0 dark:scale-100'
66+
><path
67+
fill='currentColor'
68+
d='M12.058 20q-3.334 0-5.667-2.333Q4.058 15.333 4.058 12q0-3.038 1.98-5.27Q8.02 4.5 10.942 4.097q.081 0 .159.006t.153.017q-.506.706-.801 1.57q-.295.865-.295 1.811q0 2.667 1.866 4.533q1.867 1.867 4.534 1.867q.952 0 1.813-.295q.862-.295 1.548-.801q.012.075.018.153q.005.078.005.158q-.384 2.923-2.615 4.904T12.057 20'
69+
></path></svg
70+
>
6571
</button>
6672
</div>
6773
</nav>

src/pages/cv/index.astro

+83
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
---
2+
import PageLayout from "@/layouts/BaseLayout.astro";
3+
import PublicationList from "@/components/PublicationList.astro";
4+
import Section from "@/components/Section.astro";
5+
import Card from "@/components/Card.astro";
6+
7+
import { sortPublicationFn } from "@/utils";
8+
9+
import type { Publication } from "@/utils";
10+
11+
import selectedPubs from "@/assets/publications.json";
12+
13+
const sortedSelectedPubs = selectedPubs
14+
.filter((pub: Publication) => pub.marked)
15+
.sort(sortPublicationFn);
16+
---
17+
18+
<PageLayout meta={{ title: "CV" }}>
19+
<div class='flex max-w-[50rem] flex-col gap-y-10'>
20+
<h1 class='mb-6 mt-5 text-2xl font-bold'>Summarized CV</h1>
21+
22+
<Section title='Experience'>
23+
<Card
24+
heading='Vector Institute'
25+
subheading='Postdoctoral Fellow'
26+
date='Feb 2023 - '
27+
>
28+
With Alán Aspuru-Guzik and Pascal Poupart.
29+
</Card>
30+
31+
<Card
32+
heading='University of Tuebingen'
33+
subheading='PhD, Computer Science'
34+
date='Jun 2019 - Jan 2023'
35+
>
36+
With Philipp Hennig and Matthias Hein.
37+
</Card>
38+
39+
<Card
40+
heading='University of Bonn'
41+
subheading='MSc, Computer Science'
42+
date='Apr 2017 - Apr 2019'
43+
>
44+
With Asja Fischer and Jens Lehmann.
45+
</Card>
46+
47+
<Card
48+
heading='GDP Venture'
49+
subheading='Software Engineer'
50+
date='Apr 2013 - Dec 2015'
51+
/>
52+
53+
<Card
54+
heading='Universitas Atma Jaya Yogyakarta'
55+
subheading='BEng, Software Engineering'
56+
date='Aug 2009 - Jan 2013'
57+
/>
58+
</Section>
59+
60+
<Section title='Awards'>
61+
<Card
62+
heading='Best PhD thesis'
63+
subheading="German Research Foundation's Theoretical Foundations of Deep Learning program, 2023"
64+
/>
65+
66+
<Card heading='Spotlight paper (top 4%)' subheading='NeurIPS 2023' />
67+
68+
<Card heading='Spotlight paper (top 3%)' subheading='NeurIPS 2021' />
69+
70+
<Card heading='Long-talk paper (top 6%)' subheading='UAI 2021' />
71+
72+
<Card heading='Best reviewer (top 10%)' subheading='ICML 2021' />
73+
</Section>
74+
75+
{
76+
sortedSelectedPubs.length > 0 && (
77+
<Section title='Selected Works'>
78+
<PublicationList publications={sortedSelectedPubs} />
79+
</Section>
80+
)
81+
}
82+
</div>
83+
</PageLayout>

src/pages/index.astro

+24-65
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,18 @@ import Button from "../components/Button.astro";
44
import Section from "../components/Section.astro";
55
import Card from "../components/Card.astro";
66
import Label from "../components/Label.astro";
7+
import News from "../components/News.astro";
78
import PostPreview from "@/components/blog/PostPreview.astro";
8-
import PublicationList from "@/components/PublicationList.astro";
99
import { Image } from "astro:assets";
1010
11+
import portrait from "../assets/portrait.jpeg";
12+
import news from "../assets/news.json";
13+
14+
import type { NewsPost } from "@/utils";
15+
1116
import { getAllPosts, sortMDByDate } from "@/utils";
12-
import type { Publication } from "@/utils";
1317
import { sortPublicationFn } from "@/utils";
1418
15-
import portrait from "../assets/portrait.jpeg";
16-
1719
const interests = [
1820
"Probabilistic ML",
1921
"Foundation Models",
@@ -24,14 +26,16 @@ const interests = [
2426
"Riemannian Geometry",
2527
];
2628
29+
const MAX_NEWS = 10;
30+
const sortedNews = news
31+
.sort((post1: NewsPost, post2: NewsPost) => {
32+
return new Date(post2.date).getTime() - new Date(post1.date).getTime(); // descending
33+
})
34+
.slice(0, MAX_NEWS);
35+
2736
const MAX_POSTS = 10;
2837
const allPosts = await getAllPosts();
2938
const allPostsByDate = sortMDByDate(allPosts).slice(0, MAX_POSTS);
30-
31-
import selectedPubs from "../assets/publications.json";
32-
const sortedSelectedPubs = selectedPubs
33-
.filter((pub: Publication) => pub.marked)
34-
.sort(sortPublicationFn);
3539
---
3640

3741
<PageLayout meta={{ title: "About" }}>
@@ -186,71 +190,26 @@ const sortedSelectedPubs = selectedPubs
186190
</div>
187191
</Section>
188192

189-
<Section title='Experience'>
190-
<Card
191-
heading='Vector Institute'
192-
subheading='Postdoctoral Fellow'
193-
date='Feb 2023 - '
194-
>
195-
With Alán Aspuru-Guzik and Pascal Poupart.
196-
</Card>
197-
198-
<Card
199-
heading='University of Tuebingen'
200-
subheading='PhD, Computer Science'
201-
date='Jun 2019 - Jan 2023'
202-
>
203-
With Philipp Hennig and Matthias Hein.
204-
</Card>
205-
206-
<Card
207-
heading='University of Bonn'
208-
subheading='MSc, Computer Science'
209-
date='Apr 2017 - Apr 2019'
210-
>
211-
With Asja Fischer and Jens Lehmann.
212-
</Card>
213-
214-
<Card
215-
heading='GDP Venture'
216-
subheading='Software Engineer'
217-
date='Apr 2013 - Dec 2015'
218-
/>
219-
220-
<Card
221-
heading='Universitas Atma Jaya Yogyakarta'
222-
subheading='BEng, Software Engineering'
223-
date='Aug 2009 - Jan 2013'
224-
/>
225-
</Section>
226-
227-
<Section title='Awards'>
228-
<Card
229-
heading='Best PhD thesis'
230-
subheading="German Research Foundation's Theoretical Foundations of Deep Learning program, 2023"
231-
/>
232-
233-
<Card heading='Spotlight paper (top 4%)' subheading='NeurIPS 2023' />
234-
235-
<Card heading='Spotlight paper (top 3%)' subheading='NeurIPS 2021' />
236-
237-
<Card heading='Long-talk paper (top 6%)' subheading='UAI 2021' />
238-
239-
<Card heading='Best reviewer (top 10%)' subheading='ICML 2021' />
240-
</Section>
193+
<hr />
241194

242195
{
243-
allPostsByDate.length > 0 && (
244-
<Section title='Selected Works'>
245-
<PublicationList publications={sortedSelectedPubs} />
196+
sortedNews.length > 0 && (
197+
<Section title='News'>
198+
<ul class='flex flex-col gap-y-5 sm:gap-y-4'>
199+
{sortedNews.map((p) => (
200+
<News news={p} />
201+
))}
202+
</ul>
246203
</Section>
247204
)
248205
}
249206

207+
<hr />
208+
250209
{
251210
allPostsByDate.length > 0 && (
252211
<Section title='Latest Posts'>
253-
<ul class='flex flex-col gap-y-5 sm:gap-y-2'>
212+
<ul class='flex flex-col gap-y-5 sm:gap-y-4'>
254213
{allPostsByDate.slice(0, 5).map((p) => (
255214
<PostPreview post={p} maxDescWords={18} withDesc />
256215
))}

src/site.config.ts

+4
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ export const menuLinks: Array<{ title: string; path: string }> = [
2929
title: "Home",
3030
path: "/",
3131
},
32+
{
33+
title: "CV",
34+
path: "/cv/",
35+
},
3236
{
3337
title: "Blog",
3438
path: "/blog/",

src/utils/index.ts

+4-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ export {
88
} from "./post";
99
export { getFormattedDate } from "./date";
1010
export { generateToc } from "./generateToc";
11-
export type { TocItem } from "./generateToc";
1211
export { elementHasClass, toggleClass, rootInDarkMode } from "./domElement";
13-
export type { Publication } from "./publication";
1412
export { sortPublicationFn } from "./publication";
13+
14+
export type { TocItem } from "./generateToc";
15+
export type { Publication } from "./publication";
16+
export type { NewsPost } from "./news.ts";

src/utils/news.ts

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export interface NewsPost {
2+
date: string;
3+
post: string;
4+
}

0 commit comments

Comments
 (0)