fix home page post links
This commit is contained in:
parent
f50259f1df
commit
87540cfebc
|
@ -4,6 +4,7 @@ import Header from '../components/Header.astro';
|
||||||
import Footer from '../components/Footer.astro';
|
import Footer from '../components/Footer.astro';
|
||||||
import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
|
import { SITE_TITLE, SITE_DESCRIPTION } from '../consts';
|
||||||
import { getCollection } from 'astro:content';
|
import { getCollection } from 'astro:content';
|
||||||
|
import slugify from "@utils/sligify";
|
||||||
|
|
||||||
const featuredProjects = (await getCollection('projects', (item) => item.data.featured));
|
const featuredProjects = (await getCollection('projects', (item) => item.data.featured));
|
||||||
const latestPosts = (await getCollection('posts'))
|
const latestPosts = (await getCollection('posts'))
|
||||||
|
@ -56,7 +57,7 @@ const latestPosts = (await getCollection('posts'))
|
||||||
<div class="post-list">
|
<div class="post-list">
|
||||||
{
|
{
|
||||||
latestPosts.map((post) => (
|
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>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue