From 30373718d080631967c055b505d5ec507cd36d50 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 3 Oct 2026 11:37:41 +0000 Subject: [PATCH 1/5] Kit: let a site point the language link at its own page MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A header with data-lang-cn / data-lang-en now sends the 中文 / English link to that URL instead of the interimm.org home page, so sub-sites with their own translations keep visitors on the same site. nav..json gains a "lang" key per language for this. Also notes caching and asset version stamps in kit/README.md. Co-Authored-By: Claude Opus 5.5 (1M context) Claude-Session: https://claude.ai/code/session_01EZdfMMy2aM8X4PGqUv2p7N --- assets/kit/interimm.js | 11 ++++++++--- kit/README.md | 11 +++++++++++ layouts/partials/kit.html | 2 +- 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/assets/kit/interimm.js b/assets/kit/interimm.js index 2a60b8c..28d8d81 100644 --- a/assets/kit/interimm.js +++ b/assets/kit/interimm.js @@ -20,7 +20,12 @@ const GITHUB_ICON = ''; const MENU_ICON = ''; - const renderHeader = (nav, current) => { + // A site with its own page in another language names it on the header, e.g. + // data-lang-cn="https://cities.interimm.org/?lang=cn"; otherwise the language + // link goes to that language's interimm.org home page. + const langUrl = (header, l) => header.getAttribute(`data-lang-${l.lang}`) || l.url; + + const renderHeader = (header, nav, current) => { const link = (item) => `${esc(item.name)}`; const items = nav.menu.map((item) => { if (item.children && item.children.length) { @@ -29,7 +34,7 @@ } return `