From 6c626f8cef44df56ce22fdf59ba9a2938fc47122 Mon Sep 17 00:00:00 2001 From: JxM Date: Mon, 20 Oct 2025 17:23:07 +0200 Subject: [PATCH 01/34] fix social icons --- astro.config.mjs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/astro.config.mjs b/astro.config.mjs index 26373eab..f5682c91 100644 --- a/astro.config.mjs +++ b/astro.config.mjs @@ -63,9 +63,13 @@ export default defineConfig({ Header: "./src/components/Header.astro", PageSidebar: "./src/components/PageSidebar.astro", }, - social: { - github: "https://github.com/interledger", - }, + social: [ + { + icon: "github", + label: "GitHub", + href: "https://github.com/interledger" + }, + ], sidebar: [ { label: "Overview", From e5bc8896d42353f40a8b94f2f65d63de8fc3c3bb Mon Sep 17 00:00:00 2001 From: JxM Date: Mon, 20 Oct 2025 13:49:10 +0200 Subject: [PATCH 02/34] feat: add language switch to Startlight docs headers --- src/components/Header.astro | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Header.astro b/src/components/Header.astro index a6006b48..d7182acb 100644 --- a/src/components/Header.astro +++ b/src/components/Header.astro @@ -4,6 +4,10 @@ import Search from "@astrojs/starlight/components/Search.astro"; import SocialIcons from "@astrojs/starlight/components/SocialIcons.astro"; import ThemeSelect from "@astrojs/starlight/components/ThemeSelect.astro"; import DevelopersLogo from "./logos/DevelopersLogo.astro"; +import LanguagePicker from "./LanguagePicker.astro"; +import { getLangFromUrl } from "../i18n/utils"; + +const lang = getLangFromUrl(Astro.url); ---
@@ -24,10 +28,10 @@ import DevelopersLogo from "./logos/DevelopersLogo.astro";
-
+
diff --git a/src/components/LanguagePicker.astro b/src/components/LanguagePicker.astro index 15a16234..d0bd8f2f 100644 --- a/src/components/LanguagePicker.astro +++ b/src/components/LanguagePicker.astro @@ -7,6 +7,20 @@ const translatePath = useTranslatedPath(defaultLang, lang); --- + + From 3f2beb87e566b22587784e7fb3b8c531ebb3910a Mon Sep 17 00:00:00 2001 From: JxM Date: Mon, 1 Dec 2025 17:10:15 +0100 Subject: [PATCH 25/34] fix: translate tech blog title /desc --- src/pages/blog/[...page].astro | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pages/blog/[...page].astro b/src/pages/blog/[...page].astro index f360bfd4..0c289e90 100644 --- a/src/pages/blog/[...page].astro +++ b/src/pages/blog/[...page].astro @@ -4,6 +4,7 @@ import { createExcerpt } from '../../utils/create-excerpt'; import BaseLayout from '../../layouts/BaseLayout.astro'; import Pagination from '../../components/blog/Pagination.astro'; import { getCollection } from 'astro:content'; +import { useTranslations } from '../../../i18n/utils'; type Props = { page: Page; @@ -16,7 +17,9 @@ export async function getStaticPaths({ paginate }: any) { return paginate(blogEntries, { pageSize: 10 }); } +const { lang } = Astro.params; const { page } = Astro.props; +const t = useTranslations(lang as string); ---
From 814c40dc0810c889562fa461b9efc250da343452 Mon Sep 17 00:00:00 2001 From: JxM Date: Mon, 1 Dec 2025 17:15:50 +0100 Subject: [PATCH 26/34] fix: hreflang tags in head --- src/layouts/BaseLayout.astro | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/layouts/BaseLayout.astro b/src/layouts/BaseLayout.astro index 33735450..c81e1922 100644 --- a/src/layouts/BaseLayout.astro +++ b/src/layouts/BaseLayout.astro @@ -1,8 +1,8 @@ --- import FoundationHeader from '../components/pages/FoundationHeader.astro'; import FoundationFooter from '../components/pages/FoundationFooter.astro'; -import { getLangFromUrl } from '../i18n/utils'; -import { languages } from '../i18n/ui'; +import { getLangFromUrl, useTranslatedPath } from '../i18n/utils'; +import { languages, defaultLang } from '../i18n/ui'; import '../styles/pages.css'; interface Props { @@ -18,24 +18,26 @@ const { title, description, ogType, ogImageUrl, canonicalURL = new URL(Astro.url const lang = getLangFromUrl(Astro.url); // Generate alternate URLs for hreflang -const currentPath = Astro.url.pathname; +const translatePath = useTranslatedPath(defaultLang, lang); const alternateUrls: Record = {}; +// Normalize path by removing existing language segment +const pathSegments = Astro.url.pathname.split("/"); +const isDevelopersPath = Astro.url.pathname.includes("/developers"); +const langIndex = isDevelopersPath ? 2 : 1; + +if (pathSegments[langIndex] && pathSegments[langIndex] in languages) { + pathSegments.splice(langIndex, 1); +} +const normalizedPath = pathSegments.join("/") || (isDevelopersPath ? "/developers" : "/"); + Object.keys(languages).forEach((locale) => { - if (locale === 'en') { - // English is the default, remove /en prefix if present - alternateUrls[locale] = new URL(currentPath.replace(/^\/es\//, '/'), Astro.site).href; - } else { - // Add language prefix for non-default languages - const localizedPath = currentPath.startsWith(`/${locale}/`) - ? currentPath - : `/${locale}${currentPath}`; - alternateUrls[locale] = new URL(localizedPath, Astro.site).href; - } + const translatedPath = translatePath(normalizedPath, locale as keyof typeof languages); + alternateUrls[locale] = new URL(translatedPath, Astro.site).href; }); // x-default points to English version -const defaultUrl = alternateUrls['en']; +const defaultUrl = alternateUrls[defaultLang]; --- From 33b86d84f0311cd1b3f397f3901da7dc69b48734 Mon Sep 17 00:00:00 2001 From: Jonathan Matthey Date: Tue, 2 Dec 2025 15:35:20 +0100 Subject: [PATCH 27/34] Update src/pages/blog/[...page].astro Co-authored-by: Anca Matei <98110730+Anca2022@users.noreply.github.com> --- src/pages/blog/[...page].astro | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/blog/[...page].astro b/src/pages/blog/[...page].astro index 0c289e90..2c29f834 100644 --- a/src/pages/blog/[...page].astro +++ b/src/pages/blog/[...page].astro @@ -4,7 +4,7 @@ import { createExcerpt } from '../../utils/create-excerpt'; import BaseLayout from '../../layouts/BaseLayout.astro'; import Pagination from '../../components/blog/Pagination.astro'; import { getCollection } from 'astro:content'; -import { useTranslations } from '../../../i18n/utils'; +import { useTranslations } from '../../i18n/utils'; type Props = { page: Page; From bb6e3590c9ce53752b9e9aa60fd0ac9aade117bb Mon Sep 17 00:00:00 2001 From: Jonathan Matthey Date: Tue, 2 Dec 2025 15:36:05 +0100 Subject: [PATCH 28/34] Update src/i18n/ui.ts Co-authored-by: Anca Matei <98110730+Anca2022@users.noreply.github.com> --- src/i18n/ui.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/i18n/ui.ts b/src/i18n/ui.ts index ecc8227d..e209efdf 100644 --- a/src/i18n/ui.ts +++ b/src/i18n/ui.ts @@ -50,7 +50,7 @@ export const ui: LanguageUi = { "footer.mailing-list": "Join our mailing list", "footer.subscribe": "Subscribe", "footer.connect": "Connect with us", - "footer.copyright": "© 2020–2025, Interledger Foundation. All rights reserved.", + "footer.copyright": "All rights reserved.", "footer.terms": "Terms of Service", "footer.privacy": "Privacy Policy", "footer.contact": "Contact Us", From 81c83419e3234e253e2f3ba45e96cd6ac4bc92f5 Mon Sep 17 00:00:00 2001 From: Jonathan Matthey Date: Tue, 2 Dec 2025 15:41:27 +0100 Subject: [PATCH 29/34] fix lang --- src/pages/blog/[...page].astro | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pages/blog/[...page].astro b/src/pages/blog/[...page].astro index 2c29f834..9218ac93 100644 --- a/src/pages/blog/[...page].astro +++ b/src/pages/blog/[...page].astro @@ -4,7 +4,7 @@ import { createExcerpt } from '../../utils/create-excerpt'; import BaseLayout from '../../layouts/BaseLayout.astro'; import Pagination from '../../components/blog/Pagination.astro'; import { getCollection } from 'astro:content'; -import { useTranslations } from '../../i18n/utils'; +import { useTranslations, getLangFromUrl} from '../../i18n/utils'; type Props = { page: Page; @@ -17,9 +17,10 @@ export async function getStaticPaths({ paginate }: any) { return paginate(blogEntries, { pageSize: 10 }); } -const { lang } = Astro.params; +const lang = getLangFromUrl(Astro.url); const { page } = Astro.props; -const t = useTranslations(lang as string); +const t = useTranslations(lang); + ---
From 05730bc9e523f6fb9c465664900f4280a312e32f Mon Sep 17 00:00:00 2001 From: Jonathan Matthey Date: Tue, 2 Dec 2025 15:45:50 +0100 Subject: [PATCH 30/34] add translation t --- src/components/pages/Footer.astro | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/components/pages/Footer.astro b/src/components/pages/Footer.astro index 8da17a44..8f7c4b15 100644 --- a/src/components/pages/Footer.astro +++ b/src/components/pages/Footer.astro @@ -1,4 +1,8 @@ --- +import { getLangFromUrl, useTranslations } from "../../i18n/utils"; + +const lang = getLangFromUrl(Astro.url); +const t = useTranslations(lang); const currentYear = new Date().getFullYear(); ---