From 3f0c220773f914eca3f5d29362d2f426d29417fa Mon Sep 17 00:00:00 2001 From: Gao Sun Date: Fri, 27 Dec 2024 12:39:43 +0800 Subject: [PATCH] refactor: update card design --- src/components/Card.astro | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/components/Card.astro b/src/components/Card.astro index caa8668..aa7a975 100644 --- a/src/components/Card.astro +++ b/src/components/Card.astro @@ -1,6 +1,8 @@ --- import { defaultLocale } from "astro-i18n-aut"; import type { CollectionEntry } from "astro:content"; +import { getLocaleFromUrl } from "../utils/locale"; +import { getPhrases } from "../phrases"; type Props = { entry: CollectionEntry<"terms">; @@ -13,6 +15,8 @@ const { const slug = rawSlug.startsWith(`${defaultLocale}/`) ? rawSlug.slice(defaultLocale.length + 1) : rawSlug; +const locale = getLocaleFromUrl(Astro.url); +const phrases = getPhrases(locale); ---
@@ -22,6 +26,10 @@ const slug = rawSlug.startsWith(`${defaultLocale}/`)

{description}

+
+