fix home page post links

This commit is contained in:
Chris W 2024-01-03 16:17:36 -07:00
parent f50259f1df
commit 87540cfebc
1 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import Header from '../components/Header.astro';
import Footer from '../components/Footer.astro';
import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
import { getCollection } from 'astro:content';
import slugify from "@utils/sligify";
const featuredProjects = (await getCollection('projects', (item) => item.data.featured));
const latestPosts = (await getCollection('posts'))
@ -56,7 +57,7 @@ const latestPosts = (await getCollection('posts'))
<div class="post-list">
{
latestPosts.map((post) => (
<a href="{post.url}" title={post.data.title}><b>{post.data.title}</b></a>
<a href={`/posts/${post.slug}`} title={post.data.title}><b>{post.data.title}</b></a>
))
}
</div>