From c9a4f51e36587dccbf9251fdcf627c8a59a392be Mon Sep 17 00:00:00 2001 From: Jumpei Ogawa Date: Thu, 30 Apr 2026 18:55:53 +0900 Subject: [PATCH 1/6] chore: update AI instructions --- AGENT.md | 1 + 1 file changed, 1 insertion(+) diff --git a/AGENT.md b/AGENT.md index c8dfc47..25d94b3 100644 --- a/AGENT.md +++ b/AGENT.md @@ -58,6 +58,7 @@ This project does not use npm scripts. Instead, use `mise` tasks: - 2 space indentation (configured in .editorconfig) - Use ExternalLink component for external URLs - Responsive design implemented via SCSS breakpoints +- Add file extensions (e.g., ".ts") when you `import` the local files ## Important Files From 62e002820e57e5d5ce76769937e4052d5fc7acd1 Mon Sep 17 00:00:00 2001 From: Jumpei Ogawa Date: Thu, 30 Apr 2026 14:49:40 +0900 Subject: [PATCH 2/6] feat: set up i18n --- astro.config.ts | 9 +++++++ src/assets/scss/base/_mixins.scss | 4 ---- src/components/Footer.astro | 12 +++++++--- src/components/Hero.astro | 9 +++++-- src/components/LanguagePicker.astro | 29 ++++++++++++++++++++++ src/layouts/DefaultLayout.astro | 4 +++- src/libs/i18n/configs.ts | 8 +++++++ src/libs/i18n/translations.ts | 36 ++++++++++++++++++++++++++++ src/libs/i18n/utils.ts | 13 ++++++++++ src/pages/{ => [locale]}/404.astro | 5 ++++ src/pages/{ => [locale]}/index.astro | 5 ++++ 11 files changed, 124 insertions(+), 10 deletions(-) create mode 100644 src/components/LanguagePicker.astro create mode 100644 src/libs/i18n/configs.ts create mode 100644 src/libs/i18n/translations.ts create mode 100644 src/libs/i18n/utils.ts rename src/pages/{ => [locale]}/404.astro (75%) rename src/pages/{ => [locale]}/index.astro (53%) diff --git a/astro.config.ts b/astro.config.ts index 3aaf45a..d938031 100644 --- a/astro.config.ts +++ b/astro.config.ts @@ -4,6 +4,7 @@ import compress from "astro-compress"; import icon from "astro-icon"; import mdx from "@astrojs/mdx"; import tailwindcss from "@tailwindcss/vite"; +import { defaultLocale, locales } from "./src/libs/i18n/configs.ts"; export default defineConfig({ compressHTML: true, @@ -11,6 +12,14 @@ export default defineConfig({ trailingSlash: "always", + i18n: { + locales, + defaultLocale, + routing: { + prefixDefaultLocale: true, + }, + }, + integrations: [ mdx(), icon(), diff --git a/src/assets/scss/base/_mixins.scss b/src/assets/scss/base/_mixins.scss index f811ad1..7988b05 100644 --- a/src/assets/scss/base/_mixins.scss +++ b/src/assets/scss/base/_mixins.scss @@ -1,8 +1,6 @@ @mixin text-decoration( $color: var(--text-decoration-color), $hoverColor: var(--text-decoration-hover-color), - $thickness: 2px, - $hoverThickness: 1px, $underlineOffset: 4px, $hoverUnderlineOffset: 2px ) { @@ -12,13 +10,11 @@ text-decoration-line: underline; text-decoration-style: solid; text-decoration-color: $color; - text-decoration-thickness: $thickness; text-decoration-skip-ink: none; text-underline-offset: $underlineOffset; &:where(:hover, :focus-visible) { text-decoration-color: $hoverColor; - text-decoration-thickness: $hoverThickness; text-underline-offset: $hoverUnderlineOffset; } } diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 41b7c50..d324659 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -1,12 +1,17 @@ --- +import { useTranslations } from "@libs/i18n/utils.ts"; import ExternalLink from "./ExternalLink.astro"; import Logo from "./Logo.astro"; +import LanguagePicker from "./LanguagePicker.astro"; +import { defaultLocale } from "@libs/i18n/configs.ts"; /** * Footer Component * @description A component that displays the footer of the website */ const currentYear = new Date().getFullYear(); +const locale = Astro.currentLocale ?? Astro.preferredLocale ?? defaultLocale; +const t = useTranslations(locale); --- diff --git a/src/components/Hero.astro b/src/components/Hero.astro index f52129c..4007674 100644 --- a/src/components/Hero.astro +++ b/src/components/Hero.astro @@ -1,7 +1,12 @@ --- import { Icon } from "astro-icon/components"; import { Image } from "astro:assets"; +import { useTranslations } from "@libs/i18n/utils"; import heroImage from "@assets/images/hero.png"; +import { defaultLocale } from "@libs/i18n/configs.ts"; + +const lang = Astro.currentLocale ?? Astro.preferredLocale ?? defaultLocale; +const t = useTranslations(lang); ---
@@ -15,10 +20,10 @@ import heroImage from "@assets/images/hero.png";
- Watch on GitHub + {t("hero.watch-github")}
- Coming soon + {t("hero.coming-soon")}
+ {footerLinks.map(({ section, items }) => ( +
+

{section}

+
    + {items.map(({ text, href }) => ( +
  • + { + (href.startsWith("/") || href.startsWith(".")) ? ( + {text} + ) : ( + {text} + ) + } +
  • + ))} +
+
+ ))}
From 1978f0dcd8acbef3d095ae507a250be0a03c2786 Mon Sep 17 00:00:00 2001 From: Jumpei Ogawa Date: Thu, 30 Apr 2026 17:51:47 +0900 Subject: [PATCH 6/6] feat: update copyright --- src/components/Footer.astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/Footer.astro b/src/components/Footer.astro index fa1e38e..6436d8e 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -71,7 +71,7 @@ const footerLinks = [
-

© {currentYear} Jumpei Ogawa

+

© 2025-{currentYear} tenkumo, Inc.