Refactor related posts functions

This commit is contained in:
prototypa
2024-04-14 18:45:29 -04:00
parent cc6dbfbcdf
commit 55459a6103
4 changed files with 39 additions and 42 deletions

View File

@@ -11,8 +11,8 @@ export interface Props {
}
const { post } = Astro.props;
const fetchedPosts = await fetchPosts();
const relatedPosts = post.tags ? getRelatedPosts(fetchedPosts, post.slug, post.tags) : [];
const relatedPosts = post.tags ? await getRelatedPosts(post, 4) : [];
---
{