aboutsummaryrefslogtreecommitdiffstats
path: root/src/pages/index.astro
diff options
context:
space:
mode:
Diffstat (limited to 'src/pages/index.astro')
-rw-r--r--src/pages/index.astro90
1 files changed, 38 insertions, 52 deletions
diff --git a/src/pages/index.astro b/src/pages/index.astro
index 019283d..9549a7c 100644
--- a/src/pages/index.astro
+++ b/src/pages/index.astro
@@ -1,13 +1,15 @@
---
import BlogCard from '@/components/BlogCard.astro'
+import EventCard from '@/components/EventCard.astro'
import Link from '@/components/Link.astro'
import PageHead from '@/components/PageHead.astro'
import { buttonVariants } from '@/components/ui/button'
import { SITE } from '@/consts'
import Layout from '@/layouts/Layout.astro'
-import { getRecentPosts } from '@/lib/data-utils'
+import { getRecentPosts, getRecentEvents } from '@/lib/data-utils'
const blog = await getRecentPosts(SITE.featuredPostCount)
+const events = await getRecentEvents(SITE.featuredEventsCount)
---
<Layout class="max-w-3xl">
@@ -16,69 +18,53 @@ const blog = await getRecentPosts(SITE.featuredPostCount)
<div class="flex flex-col space-y-1.5 p-6">
<h3 class="text-3xl leading-none font-medium">er·u·dite</h3>
<p class="text-muted-foreground text-sm">
- /ˈer(y)əˌdīt/ &bull; <span class="font-medium">adjective</span>
+ /ˈer(y)əˌdīt/ &bull; <span class="font-medium">adjective</span>
</p>
</div>
- <div class="p-6 pt-0">
- <p class="text-muted-foreground mb-2 text-sm">
- astro-erudite is an opinionated, unstyled static blogging template built
- with <Link
- href="https://astro.build"
- class="text-foreground"
- external
- underline>Astro</Link
- >, <Link
- href="https://tailwindcss.com"
- class="text-foreground"
- external
- underline>Tailwind</Link
- >, and <Link
- href="https://ui.shadcn.com"
- class="text-foreground"
- external
- underline>shadcn/ui</Link
- >. Extraordinarily loosely based on the <Link
- href="https://astro-micro.vercel.app/"
- class="text-foreground"
- external
- underline>Astro Micro</Link
- > theme.
- </p>
- <p class="text-muted-foreground text-sm">
- To use this template, check out the <Link
- href="https://github.com/jktrn/astro-erudite"
- class="text-foreground"
- underline
- external>GitHub</Link
- > repository. To learn more about why this template exists, read this blog
- post: <Link
- href="/blog/the-state-of-static-blogs"
- class="text-foreground"
- underline>The State of Static Blogs in 2024</Link
- >.
- </p>
+ </section>
+ <section class="flex flex-col gap-y-4">
+ <h2 class="text-2xl font-medium">Latest events</h2>
+ <ul class="flex flex-col gap-y-4">
+ {
+ events.map((event) => (
+ <li>
+ <EventCard entry={event} />
+ </li>
+ ))
+ }
+ </ul>
+ <div class="flex justify-center">
+ <Link
+ href="/events"
+ class={buttonVariants({ variant: 'ghost' }) + ' group'}
+ >
+ See all posts <span
+ class="ml-1.5 transition-transform group-hover:translate-x-1"
+ >&rarr;</span
+ >
+ </Link>
</div>
</section>
<section class="flex flex-col gap-y-4">
<h2 class="text-2xl font-medium">Latest posts</h2>
<ul class="flex flex-col gap-y-4">
{
- blog.map((post) => (
- <li>
- <BlogCard entry={post} />
- </li>
- ))
+ blog.map((post) => (
+ <li>
+ <BlogCard entry={post} />
+ </li>
+ ))
}
</ul>
<div class="flex justify-center">
<Link
- href="/blog"
- class={buttonVariants({ variant: 'ghost' }) + ' group'}
- >
- See all posts <span
- class="ml-1.5 transition-transform group-hover:translate-x-1"
- >&rarr;</span
- >
+ href="/blog"
+ class={buttonVariants({ variant: 'ghost' }) + ' group'}
+ >
+ See all posts <span
+ class="ml-1.5 transition-transform group-hover:translate-x-1"
+ >&rarr;</span
+ >
</Link>
</div>
</section>