fix-related-cards: adds property for other languages
This commit is contained in:
parent
e0999ad21d
commit
e4e2f088be
2 changed files with 4 additions and 3 deletions
|
@ -4,16 +4,17 @@ import { Image } from "astro:assets";
|
|||
import { formatDate } from "@utils/utils";
|
||||
import type { CollectionEntry } from "astro:content";
|
||||
|
||||
const { blogEntry } = Astro.props;
|
||||
const { blogEntry, recentBlogLocale = "" } = Astro.props;
|
||||
|
||||
interface Props {
|
||||
blogEntry: CollectionEntry<"blog">;
|
||||
recentBlogLocale?: string;
|
||||
}
|
||||
---
|
||||
|
||||
<a
|
||||
class="group block rounded-xl outline-none ring-zinc-500 transition duration-300 focus-visible:ring dark:ring-zinc-200 dark:focus:outline-none"
|
||||
href={`/blog/${blogEntry.slug}/`}
|
||||
href={recentBlogLocale !== "" ? `/${recentBlogLocale}/blog/${blogEntry.slug}/` : `/blog/${blogEntry.slug}/`}
|
||||
data-astro-prefetch
|
||||
>
|
||||
<div>
|
||||
|
|
|
@ -159,7 +159,7 @@ const pageTitle: string = `${post.data.title} | ${SITE.title}`;
|
|||
</div>
|
||||
|
||||
<div class="grid grid-cols-2 gap-6">
|
||||
{relatedPosts.map((entry) => <CardRelated blogEntry={entry} />)}
|
||||
{relatedPosts.map((entry) => <CardRelated blogEntry={entry} recentBlogLocale="fr" /> )}
|
||||
</div>
|
||||
</section>
|
||||
</MainLayout>
|
||||
|
|
Loading…
Add table
Reference in a new issue