Skip to content

Commit 9dc891d

Browse files
committed
add hreflang
1 parent a69d622 commit 9dc891d

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

src/components/header.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const code = t("code");
1818

1919
<div class="w-full mb-8 sticky top-0 z-50 bg-background/30 backdrop-blur">
2020
<nav class="h-16 flex items-center container mx-auto px-2.5">
21-
<a href={`/${code}`} class="flex items-center">
21+
<a href={`/${code}`} hreflang={code} class="flex items-center">
2222
<Image
2323
alt="Yeecord"
2424
src={logo}

src/components/home/home-item-container.astro

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
2-
const { href } = Astro.props;
2+
const { href, hreflang } = Astro.props;
33
---
44

55
<a
66
href={href}
7+
hreflang={hreflang}
78
class="block p-5 border border-border/40 rounded-md space-y-2 hover:bg-border/50 bg-secondary/30 transition-all active:scale-[0.975]"
89
>
910
<slot />

src/pages/[lang]/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ for (const [fromId, from] of Object.entries(calculatorConfig)) {
4646
<p>{t("global.description")}</p>
4747
<h2 class="flex items-center gap-2"><Sparkles />{t("home.recommended")}</h2>
4848
<div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
49-
<HomeItemContainer href="/zh-tw/address-to-english">
49+
<HomeItemContainer href="/zh-tw/address-to-english" hreflang="zh-TW">
5050
<Languages />
5151
<p>台灣中華郵政地址轉英文</p>
5252
</HomeItemContainer>

0 commit comments

Comments
 (0)