Skip to content

Commit 7febe6d

Browse files
committed
feat: improved homepage page
1 parent 815371a commit 7febe6d

File tree

1 file changed

+84
-12
lines changed

1 file changed

+84
-12
lines changed

src/pages/index.astro

Lines changed: 84 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,84 @@
1-
<html lang="en">
2-
<head>
3-
<meta charset="utf-8" />
4-
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
5-
<meta name="viewport" content="width=device-width" />
6-
<meta name="generator" content={Astro.generator} />
7-
<title>Astro</title>
8-
</head>
9-
<body>
10-
<h1>Astro</h1>
11-
</body>
12-
</html>
1+
---
2+
import { getEntry, getCollection, render } from 'astro:content';
3+
import BaseLayout from '@/layouts/BaseLayout.astro';
4+
import Container from '@/components/Container.astro';
5+
import Author from '@/components/ui/Author.astro';
6+
import { DEFAULT_CONFIGURATION } from '@/lib/constants';
7+
import WorkExperience from '@/components/ui/WorkExperience.astro';
8+
import Talk from '@/components/ui/Talk.astro';
9+
10+
const entry = await getEntry('pages', 'homepage');
11+
12+
if (!entry) {
13+
throw new Error('Homepage content not found in src/content/pages');
14+
}
15+
16+
const { Content } = await render(entry);
17+
18+
const links = await getCollection('links');
19+
const jobs = await getCollection('jobs');
20+
const talks = await getCollection('talks');
21+
---
22+
23+
<BaseLayout>
24+
<section class="py-6">
25+
<Container>
26+
<Author {...DEFAULT_CONFIGURATION.author} />
27+
</Container>
28+
</section>
29+
<section class="py-6">
30+
<Container>
31+
<div class="flex flex-col gap-6">
32+
<div class="flex items-center">
33+
<span class="text-headings">About</span>
34+
</div>
35+
<div class="prose dark:prose-invert">
36+
<Content />
37+
</div>
38+
</div>
39+
</Container>
40+
</section>
41+
{ links.length > 0 && (
42+
<section class="py-8">
43+
<Container>
44+
<div class="flex flex-col gap-5">
45+
<span class="text-headings">Contact</span>
46+
<ul class="flex flex-col gap-3">
47+
{links.map((link) => (
48+
<li class="py-0.5">
49+
<div class="flex items-center gap-5">
50+
<span class="min-w-28 text-muted-foreground">{link.data.label}</span>
51+
<a class="text-headings font-medium" rel="noopener noreferrer" target="_blank" href={link.data.url}>{link.data.name}</a>
52+
</div>
53+
</li>
54+
))}
55+
</ul>
56+
</div>
57+
</Container>
58+
</section>
59+
)}
60+
{ jobs.length > 0 && (
61+
<section class="py-6">
62+
<Container>
63+
<div class="flex flex-col gap-5">
64+
<span class="text-headings">Work Experience</span>
65+
<ul class="flex flex-col gap-8">
66+
{jobs.map((job) => <WorkExperience entry={job} />)}
67+
</ul>
68+
</div>
69+
</Container>
70+
</section>
71+
)}
72+
{talks.length > 0 && (
73+
<section class="py-6">
74+
<Container>
75+
<div class="flex flex-col gap-5">
76+
<span class="text-headings">Speaking</span>
77+
<ul class="flex flex-col gap-8">
78+
{talks.map((talk) => <Talk entry={talk} />)}
79+
</ul>
80+
</div>
81+
</Container>
82+
</section>
83+
)}
84+
</BaseLayout>

0 commit comments

Comments
 (0)