Show a dead link's destination on its own line in the card

The destination read as an afterthought at the end of the not-found
paragraph. It now has its own "→ Opens <space>" line with the space title in
bold, and the string is shortened to "Opens ${1}" in every language.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rt9YwdSUu7gHehYbEkvEJ8
This commit is contained in:
Brett Jephson
2026-09-25 12:05:40 +01:00
parent dd28fb0114
commit b8ba267c4c
40 changed files with 55 additions and 46 deletions
@@ -2,7 +2,7 @@ import { Icon } from '@gitbook/icons';
import type { DocumentContextProps } from '../DocumentView';
import { HoverCard, HoverCardRoot, HoverCardTrigger } from '../primitives';
import { getSpaceLanguage, tString } from '@/intl/server';
import { getSpaceLanguage, t, tString } from '@/intl/server';
import { defaultLanguage } from '@/intl/translations';
import type { ResolvedContentRef } from '@/lib/references';
import { checkIsExternalURL } from '@/lib/urls';
@@ -32,12 +32,21 @@ export async function NotFoundRefHoverCard(
<Icon icon="ban" className="size-4 text-tint-subtle" />
<h5 className="font-semibold">{tString(language, 'notfound_title')}</h5>
</div>
<p className="text-sm text-tint">
{tString(language, 'notfound_link')}
{destination
? ` ${tString(language, 'notfound_link_opens', destination)}`
: null}
</p>
<p className="text-sm text-tint">{tString(language, 'notfound_link')}</p>
{destination ? (
<p className="mt-1 flex items-center gap-1.5 text-sm text-tint">
<Icon icon="arrow-right" className="size-3 shrink-0 text-tint-subtle" />
<span>
{t(
language,
'notfound_link_opens',
<span className="font-semibold text-tint-strong">
{destination}
</span>
)}
</span>
</p>
) : null}
</HoverCard>
</HoverCardRoot>
);
+1 -1
View File
@@ -76,7 +76,7 @@ export const ar: TranslationLanguage = {
edit: 'تحرير',
notfound_title: 'الصفحة غير موجودة',
notfound_link: 'يشير هذا الرابط إلى صفحة تمت إزالتها أو لم تعد موجودة.',
notfound_link_opens: 'بدلاً من ذلك، يفتح هذا الرابط: ${1}.',
notfound_link_opens: 'يفتح: ${1}',
notfound: 'الصفحة التي تبحث عنها غير موجودة.',
notfound_adaptive_title: 'الصفحة غير متاحة',
notfound_adaptive: 'قد تكون هذه الصفحة موجودة، لكن قد تحتاج إلى تسجيل الدخول للوصول إليها.',
+1 -1
View File
@@ -77,7 +77,7 @@ export const bg: TranslationLanguage = {
edit: 'Редактиране',
notfound_title: 'Страницата не е намерена',
notfound_link: 'Тази връзка сочи към страница, която е премахната или вече не съществува.',
notfound_link_opens: 'Вместо това ще се отвори: ${1}.',
notfound_link_opens: 'Отваря: ${1}',
notfound: 'Страницата, която търсите, не съществува.',
notfound_adaptive_title: 'Страницата не е налична',
notfound_adaptive:
+1 -1
View File
@@ -76,7 +76,7 @@ export const cs: TranslationLanguage = {
edit: 'Upravit',
notfound_title: 'Stránka nenalezena',
notfound_link: 'Tento odkaz vede na stránku, která byla odstraněna nebo již neexistuje.',
notfound_link_opens: 'Místo toho se otevře: ${1}.',
notfound_link_opens: 'Otevře: ${1}',
notfound: 'Stránka, kterou hledáte, neexistuje.',
notfound_adaptive_title: 'Stránka není dostupná',
notfound_adaptive:
+1 -1
View File
@@ -76,7 +76,7 @@ export const da: TranslationLanguage = {
edit: 'Rediger',
notfound_title: 'Siden blev ikke fundet',
notfound_link: 'Dette link peger på en side, der er blevet fjernet eller ikke længere findes.',
notfound_link_opens: 'Den åbner ${1} i stedet.',
notfound_link_opens: 'Åbner ${1}',
notfound: 'Siden, du leder efter, findes ikke.',
notfound_adaptive_title: 'Siden er ikke tilgængelig',
notfound_adaptive:
+1 -1
View File
@@ -79,7 +79,7 @@ export const de: TranslationLanguage = {
notfound_title: 'Seite nicht gefunden',
notfound_link:
'Dieser Link verweist auf eine Seite, die entfernt wurde oder nicht mehr existiert.',
notfound_link_opens: 'Stattdessen wird ${1} geöffnet.',
notfound_link_opens: 'Öffnet ${1}',
notfound: 'Die gesuchte Seite existiert nicht.',
notfound_adaptive_title: 'Seite nicht verfügbar',
notfound_adaptive:
+1 -1
View File
@@ -77,7 +77,7 @@ export const el: TranslationLanguage = {
edit: 'Επεξεργασία',
notfound_title: 'Η σελίδα δεν βρέθηκε',
notfound_link: 'Αυτός ο σύνδεσμος οδηγεί σε μια σελίδα που έχει αφαιρεθεί ή δεν υπάρχει πλέον.',
notfound_link_opens: 'Αντί γι’ αυτό ανοίγει: ${1}.',
notfound_link_opens: 'Ανοίγει: ${1}',
notfound: 'Η σελίδα που αναζητάτε δεν υπάρχει.',
notfound_adaptive_title: 'Η σελίδα δεν είναι διαθέσιμη',
notfound_adaptive:
+1 -1
View File
@@ -74,7 +74,7 @@ export const en = {
edit: 'Edit',
notfound_title: 'Page not found',
notfound_link: 'This link points to a page that has been removed or no longer exists.',
notfound_link_opens: 'It opens ${1} instead.',
notfound_link_opens: 'Opens ${1}',
notfound: "The page you're looking for doesn't exist.",
notfound_adaptive_title: 'Page unavailable',
notfound_adaptive: 'This page may exist, but you may need to log in to access it.',
+1 -1
View File
@@ -78,7 +78,7 @@ export const es: TranslationLanguage = {
edit: 'Editar',
notfound_title: 'Página no encontrada',
notfound_link: 'Este enlace apunta a una página que ha sido eliminada o ya no existe.',
notfound_link_opens: 'En su lugar, se abre ${1}.',
notfound_link_opens: 'Abre ${1}',
notfound: 'La página que buscas no existe.',
notfound_adaptive_title: 'Página no disponible',
notfound_adaptive:
+1 -1
View File
@@ -76,7 +76,7 @@ export const et: TranslationLanguage = {
edit: 'Muuda',
notfound_title: 'Lehte ei leitud',
notfound_link: 'See link viitab lehele, mis on eemaldatud või mida enam ei eksisteeri.',
notfound_link_opens: 'Selle asemel avaneb: ${1}.',
notfound_link_opens: 'Avab: ${1}',
notfound: 'Lehte, mida otsite, ei eksisteeri.',
notfound_adaptive_title: 'Leht pole saadaval',
notfound_adaptive: 'See leht võib olemas olla, kuid juurdepääsuks võib olla vaja sisse logida.',
+1 -1
View File
@@ -77,7 +77,7 @@ export const fi: TranslationLanguage = {
edit: 'Muokkaa',
notfound_title: 'Sivua ei löytynyt',
notfound_link: 'Tämä linkki osoittaa sivulle, joka on poistettu tai jota ei enää ole.',
notfound_link_opens: 'Sen sijaan avautuu: ${1}.',
notfound_link_opens: 'Avaa: ${1}',
notfound: 'Etsimääsi sivua ei ole olemassa.',
notfound_adaptive_title: 'Sivu ei ole saatavilla',
notfound_adaptive:
+1 -1
View File
@@ -77,7 +77,7 @@ export const fr: TranslationLanguage = {
edit: 'Modifier',
notfound_title: 'Page introuvable',
notfound_link: "Ce lien pointe vers une page qui a été supprimée ou n'existe plus.",
notfound_link_opens: 'Le lien ouvre ${1} à la place.',
notfound_link_opens: 'Ouvre ${1}',
notfound: 'La page que vous cherchez n’existe pas.',
notfound_adaptive_title: 'Page inaccessible',
notfound_adaptive:
+1 -1
View File
@@ -76,7 +76,7 @@ export const he: TranslationLanguage = {
edit: 'עריכה',
notfound_title: 'הדף לא נמצא',
notfound_link: 'קישור זה מפנה לדף שהוסר או אינו קיים עוד.',
notfound_link_opens: 'במקום זאת ייפתח: ${1}.',
notfound_link_opens: 'פותח: ${1}',
notfound: 'הדף שחיפשת אינו קיים.',
notfound_adaptive_title: 'הדף אינו זמין',
notfound_adaptive: 'ייתכן שהדף קיים, אך ייתכן שעליך להתחבר כדי לגשת אליו.',
+1 -1
View File
@@ -76,7 +76,7 @@ export const hi: TranslationLanguage = {
edit: 'संपादित करें',
notfound_title: 'पृष्ठ नहीं मिला',
notfound_link: 'यह लिंक ऐसे पृष्ठ पर जाता है जिसे हटा दिया गया है या जो अब मौजूद नहीं है।',
notfound_link_opens: 'इसके बजाय ${1} खुलेगा।',
notfound_link_opens: '${1} खोलता है',
notfound: 'आप जिस पृष्ठ को खोज रहे हैं वह मौजूद नहीं है।',
notfound_adaptive_title: 'पृष्ठ उपलब्ध नहीं',
notfound_adaptive: 'यह पृष्ठ मौजूद हो सकता है, लेकिन इसे देखने के लिए आपको लॉग इन करना पड़ सकता है।',
+1 -1
View File
@@ -76,7 +76,7 @@ export const hr: TranslationLanguage = {
edit: 'Uredi',
notfound_title: 'Stranica nije pronađena',
notfound_link: 'Ova poveznica vodi na stranicu koja je uklonjena ili više ne postoji.',
notfound_link_opens: 'Umjesto toga otvara se: ${1}.',
notfound_link_opens: 'Otvara: ${1}',
notfound: 'Stranica koju tražite ne postoji.',
notfound_adaptive_title: 'Stranica nije dostupna',
notfound_adaptive:
+1 -1
View File
@@ -77,7 +77,7 @@ export const hu: TranslationLanguage = {
edit: 'Szerkesztés',
notfound_title: 'Az oldal nem található',
notfound_link: 'Ez a hivatkozás egy eltávolított vagy már nem létező oldalra mutat.',
notfound_link_opens: 'Ehelyett ez nyílik meg: ${1}.',
notfound_link_opens: 'Megnyitja: ${1}',
notfound: 'A keresett oldal nem létezik.',
notfound_adaptive_title: 'Az oldal nem érhető el',
notfound_adaptive: 'Ez az oldal létezhet, de a hozzáféréshez lehet, hogy be kell jelentkeznie.',
+1 -1
View File
@@ -76,7 +76,7 @@ export const id: TranslationLanguage = {
edit: 'Edit',
notfound_title: 'Halaman tidak ditemukan',
notfound_link: 'Tautan ini mengarah ke halaman yang telah dihapus atau sudah tidak ada.',
notfound_link_opens: 'Tautan ini akan membuka ${1} sebagai gantinya.',
notfound_link_opens: 'Membuka ${1}',
notfound: 'Halaman yang Anda cari tidak ada.',
notfound_adaptive_title: 'Halaman tidak tersedia',
notfound_adaptive:
+1 -1
View File
@@ -78,7 +78,7 @@ export const it: TranslationLanguage = {
edit: 'Modifica',
notfound_title: 'Pagina non trovata',
notfound_link: 'Questo link punta a una pagina che è stata rimossa o non esiste più.',
notfound_link_opens: 'Al suo posto si apre ${1}.',
notfound_link_opens: 'Apre ${1}',
notfound: 'La pagina che cerchi non esiste.',
notfound_adaptive_title: 'Pagina non disponibile',
notfound_adaptive:
+1 -1
View File
@@ -77,7 +77,7 @@ export const ja: TranslationLanguage = {
edit: '編集',
notfound_title: 'ページが見つかりません',
notfound_link: 'このリンクは、削除されたか、もはや存在しないページを指しています。',
notfound_link_opens: '代わりに ${1} が開きます。',
notfound_link_opens: '${1} を開きます',
notfound: 'お探しのページは存在しません。',
notfound_adaptive_title: 'ページにアクセスできません',
notfound_adaptive:
+1 -1
View File
@@ -77,7 +77,7 @@ export const ko: TranslationLanguage = {
edit: '수정',
notfound_title: '페이지를 찾을 수 없음',
notfound_link: '이 링크는 삭제되었거나 더 이상 존재하지 않는 페이지를 가리킵니다.',
notfound_link_opens: '대신 ${1}(으)로 이동합니다.',
notfound_link_opens: '${1}(으)로 이동',
notfound: '찾으시는 페이지가 존재하지 않습니다.',
notfound_adaptive_title: '페이지에 접근할 수 없음',
notfound_adaptive: '이 페이지는 존재할 수 있지만, 접근하려면 로그인해야 할 수 있습니다.',
+1 -1
View File
@@ -76,7 +76,7 @@ export const lt: TranslationLanguage = {
edit: 'Redaguoti',
notfound_title: 'Puslapis nerastas',
notfound_link: 'Ši nuoroda veda į puslapį, kuris buvo pašalintas arba nebeegzistuoja.',
notfound_link_opens: 'Vietoj to atidaromas: ${1}.',
notfound_link_opens: 'Atidaro: ${1}',
notfound: 'Puslapis, kurio ieškote, neegzistuoja.',
notfound_adaptive_title: 'Puslapis nepasiekiamas',
notfound_adaptive:
+1 -1
View File
@@ -76,7 +76,7 @@ export const lv: TranslationLanguage = {
edit: 'Rediģēt',
notfound_title: 'Lapa nav atrasta',
notfound_link: 'Šī saite norāda uz lapu, kas ir noņemta vai vairs nepastāv.',
notfound_link_opens: 'Tā vietā tiek atvērts: ${1}.',
notfound_link_opens: 'Atver: ${1}',
notfound: 'Meklētā lapa nepastāv.',
notfound_adaptive_title: 'Lapa nav pieejama',
notfound_adaptive: 'Šī lapa var pastāvēt, bet, iespējams, jums jāpierakstās, lai tai piekļūtu.',
+1 -1
View File
@@ -76,7 +76,7 @@ export const ms: TranslationLanguage = {
edit: 'Edit',
notfound_title: 'Halaman tidak ditemui',
notfound_link: 'Pautan ini menghala ke halaman yang telah dialih keluar atau tidak lagi wujud.',
notfound_link_opens: 'Pautan ini akan membuka ${1} sebagai gantinya.',
notfound_link_opens: 'Membuka ${1}',
notfound: 'Halaman yang anda cari tidak wujud.',
notfound_adaptive_title: 'Halaman tidak tersedia',
notfound_adaptive:
+1 -1
View File
@@ -78,7 +78,7 @@ export const nl: TranslationLanguage = {
edit: 'Bewerken',
notfound_title: 'Pagina niet gevonden',
notfound_link: 'Deze link verwijst naar een pagina die is verwijderd of niet meer bestaat.',
notfound_link_opens: 'In plaats daarvan wordt ${1} geopend.',
notfound_link_opens: 'Opent ${1}',
notfound: 'De pagina die je zoekt, bestaat niet.',
notfound_adaptive_title: 'Pagina niet beschikbaar',
notfound_adaptive:
+1 -1
View File
@@ -78,7 +78,7 @@ export const no: TranslationLanguage = {
notfound_title: 'Siden ble ikke funnet',
notfound_link:
'Denne lenken peker til en side som har blitt fjernet eller ikke lenger eksisterer.',
notfound_link_opens: 'Den åpner ${1} i stedet.',
notfound_link_opens: 'Åpner ${1}',
notfound: 'Siden du leter etter eksisterer ikke.',
notfound_adaptive_title: 'Siden er ikke tilgjengelig',
notfound_adaptive: 'Denne siden kan finnes, men du må kanskje logge inn for å få tilgang.',
+1 -1
View File
@@ -76,7 +76,7 @@ export const pl: TranslationLanguage = {
edit: 'Edytuj',
notfound_title: 'Nie znaleziono strony',
notfound_link: 'Ten link prowadzi do strony, która została usunięta lub już nie istnieje.',
notfound_link_opens: 'Zamiast tego otworzy się: ${1}.',
notfound_link_opens: 'Otwiera: ${1}',
notfound: 'Strona, której szukasz, nie istnieje.',
notfound_adaptive_title: 'Strona niedostępna',
notfound_adaptive: 'Ta strona może istnieć, ale dostęp do niej może wymagać zalogowania.',
@@ -78,7 +78,7 @@ export const pt_br: TranslationLanguage = {
edit: 'Editar',
notfound_title: 'Página não encontrada',
notfound_link: 'Este link aponta para uma página que foi removida ou não existe mais.',
notfound_link_opens: 'Em vez disso, ele abre ${1}.',
notfound_link_opens: 'Abre ${1}',
notfound: 'A página que você está procurando não existe.',
notfound_adaptive_title: 'Página indisponível',
notfound_adaptive:
+1 -1
View File
@@ -77,7 +77,7 @@ export const pt: TranslationLanguage = {
edit: 'Editar',
notfound_title: 'Página não encontrada',
notfound_link: 'Esta ligação aponta para uma página que foi removida ou já não existe.',
notfound_link_opens: 'Em vez disso, abre ${1}.',
notfound_link_opens: 'Abre ${1}',
notfound: 'A página que procura não existe.',
notfound_adaptive_title: 'Página indisponível',
notfound_adaptive:
+1 -1
View File
@@ -77,7 +77,7 @@ export const ro: TranslationLanguage = {
edit: 'Editează',
notfound_title: 'Pagina nu a fost găsită',
notfound_link: 'Acest link indică o pagină care a fost eliminată sau nu mai există.',
notfound_link_opens: 'În schimb, se deschide ${1}.',
notfound_link_opens: 'Deschide ${1}',
notfound: 'Pagina pe care o cauți nu există.',
notfound_adaptive_title: 'Pagina nu este disponibilă',
notfound_adaptive:
+1 -1
View File
@@ -78,7 +78,7 @@ export const ru: TranslationLanguage = {
edit: 'Редактировать',
notfound_title: 'Страница не найдена',
notfound_link: 'Эта ссылка ведёт на страницу, которая была удалена или больше не существует.',
notfound_link_opens: 'Вместо этого откроется: ${1}.',
notfound_link_opens: 'Откроется: ${1}',
notfound: 'Страница, которую вы ищете, не существует.',
notfound_adaptive_title: 'Страница недоступна',
notfound_adaptive:
+1 -1
View File
@@ -77,7 +77,7 @@ export const sk: TranslationLanguage = {
edit: 'Upraviť',
notfound_title: 'Stránka sa nenašla',
notfound_link: 'Tento odkaz smeruje na stránku, ktorá bola odstránená alebo už neexistuje.',
notfound_link_opens: 'Namiesto toho sa otvorí: ${1}.',
notfound_link_opens: 'Otvorí: ${1}',
notfound: 'Stránka, ktorú hľadáte, neexistuje.',
notfound_adaptive_title: 'Stránka nie je dostupná',
notfound_adaptive:
+1 -1
View File
@@ -77,7 +77,7 @@ export const sl: TranslationLanguage = {
edit: 'Uredi',
notfound_title: 'Strani ni bilo mogoče najti',
notfound_link: 'Ta povezava kaže na stran, ki je bila odstranjena ali ne obstaja več.',
notfound_link_opens: 'Namesto tega se odpre: ${1}.',
notfound_link_opens: 'Odpre: ${1}',
notfound: 'Stran, ki jo iščete, ne obstaja.',
notfound_adaptive_title: 'Stran ni na voljo',
notfound_adaptive: 'Ta stran morda obstaja, vendar se boste za dostop morda morali prijaviti.',
+1 -1
View File
@@ -76,7 +76,7 @@ export const sv: TranslationLanguage = {
edit: 'Redigera',
notfound_title: 'Sidan hittades inte',
notfound_link: 'Den här länken pekar på en sida som har tagits bort eller inte längre finns.',
notfound_link_opens: 'Den öppnar ${1} i stället.',
notfound_link_opens: 'Öppnar ${1}',
notfound: 'Sidan du letar efter finns inte.',
notfound_adaptive_title: 'Sidan är inte tillgänglig',
notfound_adaptive: 'Sidan kan finnas, men du kan behöva logga in för att få åtkomst.',
+1 -1
View File
@@ -75,7 +75,7 @@ export const th: TranslationLanguage = {
edit: 'แก้ไข',
notfound_title: 'ไม่พบหน้า',
notfound_link: 'ลิงก์นี้ชี้ไปยังหน้าที่ถูกลบหรือไม่มีอยู่อีกต่อไป',
notfound_link_opens: 'ลิงก์นี้จะเปิด ${1} แทน',
notfound_link_opens: 'เปิด ${1}',
notfound: 'หน้าที่คุณกำลังค้นหาไม่มีอยู่',
notfound_adaptive_title: 'หน้าไม่พร้อมใช้งาน',
notfound_adaptive: 'หน้านี้อาจมีอยู่ แต่คุณอาจต้องเข้าสู่ระบบเพื่อเข้าถึง',
+1 -1
View File
@@ -76,7 +76,7 @@ export const tr: TranslationLanguage = {
edit: 'Düzenle',
notfound_title: 'Sayfa bulunamadı',
notfound_link: 'Bu bağlantı kaldırılmış veya artık mevcut olmayan bir sayfaya işaret ediyor.',
notfound_link_opens: 'Bunun yerine ${1} açılır.',
notfound_link_opens: '${1} açılır',
notfound: 'Aradığınız sayfa mevcut değil.',
notfound_adaptive_title: 'Sayfa kullanılamıyor',
notfound_adaptive: 'Bu sayfa mevcut olabilir, ancak erişmek için oturum açmanız gerekebilir.',
+1 -1
View File
@@ -76,7 +76,7 @@ export const uk: TranslationLanguage = {
edit: 'Редагувати',
notfound_title: 'Сторінку не знайдено',
notfound_link: 'Це посилання веде на сторінку, яку видалено або якої більше не існує.',
notfound_link_opens: 'Натомість відкриється: ${1}.',
notfound_link_opens: 'Відкриється: ${1}',
notfound: 'Сторінка, яку ви шукаєте, не існує.',
notfound_adaptive_title: 'Сторінка недоступна',
notfound_adaptive: 'Ця сторінка може існувати, але для доступу до неї може знадобитися вхід.',
+1 -1
View File
@@ -76,7 +76,7 @@ export const vi: TranslationLanguage = {
edit: 'Chỉnh sửa',
notfound_title: 'Không tìm thấy trang',
notfound_link: 'Liên kết này trỏ đến một trang đã bị xóa hoặc không còn tồn tại.',
notfound_link_opens: 'Thay vào đó, liên kết sẽ mở ${1}.',
notfound_link_opens: 'Mở ${1}',
notfound: 'Trang bạn đang tìm kiếm không tồn tại.',
notfound_adaptive_title: 'Trang không khả dụng',
notfound_adaptive: 'Trang này có thể tồn tại, nhưng bạn có thể cần đăng nhập để truy cập.',
@@ -74,7 +74,7 @@ export const yue: TranslationLanguage = {
edit: '編輯',
notfound_title: '搵唔到頁面',
notfound_link: '呢條連結指向嘅頁面已被移除或已經唔存在。',
notfound_link_opens: '會改為開啟 ${1}。',
notfound_link_opens: '開啟 ${1}',
notfound: '你搵緊嘅頁面唔存在。',
notfound_adaptive_title: '頁面無法使用',
notfound_adaptive: '呢個頁面可能存在,但你可能需要登入先可以存取。',
@@ -74,7 +74,7 @@ export const zh_tw: TranslationLanguage = {
edit: '編輯',
notfound_title: '找不到頁面',
notfound_link: '此連結指向的頁面已被移除或不再存在。',
notfound_link_opens: '將改為開啟 ${1}。',
notfound_link_opens: '開啟 ${1}',
notfound: '您要尋找的頁面不存在。',
notfound_adaptive_title: '頁面無法使用',
notfound_adaptive: '此頁面可能存在,但您可能需要登入才能存取。',
+1 -1
View File
@@ -75,7 +75,7 @@ export const zh: TranslationLanguage = {
edit: '编辑',
notfound_title: '页面未找到',
notfound_link: '此链接指向已被删除或不再存在的页面。',
notfound_link_opens: '将改为打开 ${1}。',
notfound_link_opens: '打开 ${1}',
notfound: '您要找的页面不存在。',
notfound_adaptive_title: '页面无法访问',
notfound_adaptive: '该页面可能存在,但您可能需要登录后才能访问。',