The Trans Directory
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat(i18n): homepage link for 404 pages (#1117)

* Add homepage link with internationalization

* Construct pathname from baseUrl config value

* More robust URL manipulation

* Add Farsi (#1133)

* Fix bad rebase

authored by

James Bennion-Pedley and committed by
GitHub
9c726efa 81a4e202

+24
+5
quartz/components/pages/404.tsx
··· 2 2 import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "../types" 3 3 4 4 const NotFound: QuartzComponent = ({ cfg }: QuartzComponentProps) => { 5 + // If baseUrl contains a pathname after the domain, use this as the home link 6 + const url = new URL(`https://${cfg.baseUrl ?? "example.com"}`) 7 + const baseDir = url.pathname 8 + 5 9 return ( 6 10 <article class="popover-hint"> 7 11 <h1>404</h1> 8 12 <p>{i18n(cfg.locale).pages.error.notFound}</p> 13 + <a href={baseDir}>{i18n(cfg.locale).pages.error.home}</a> 9 14 </article> 10 15 ) 11 16 }
+1
quartz/i18n/locales/ar-SA.ts
··· 70 70 error: { 71 71 title: "غير موجود", 72 72 notFound: "إما أن هذه الصفحة خاصة أو غير موجودة.", 73 + home: "العوده للصفحة الرئيسية", 73 74 }, 74 75 folderContent: { 75 76 folder: "مجلد",
+1
quartz/i18n/locales/de-DE.ts
··· 65 65 error: { 66 66 title: "Nicht gefunden", 67 67 notFound: "Diese Seite ist entweder nicht öffentlich oder existiert nicht.", 68 + home: "Return to Homepage", 68 69 }, 69 70 folderContent: { 70 71 folder: "Ordner",
+1
quartz/i18n/locales/definition.ts
··· 67 67 error: { 68 68 title: string 69 69 notFound: string 70 + home: string 70 71 } 71 72 folderContent: { 72 73 folder: string
+1
quartz/i18n/locales/en-US.ts
··· 65 65 error: { 66 66 title: "Not Found", 67 67 notFound: "Either this page is private or doesn't exist.", 68 + home: "Return to Homepage", 68 69 }, 69 70 folderContent: { 70 71 folder: "Folder",
+1
quartz/i18n/locales/es-ES.ts
··· 65 65 error: { 66 66 title: "No se encontró.", 67 67 notFound: "Esta página es privada o no existe.", 68 + home: "Regresar a la página principal", 68 69 }, 69 70 folderContent: { 70 71 folder: "Carpeta",
+1
quartz/i18n/locales/fa-IR.ts
··· 65 65 error: { 66 66 title: "یافت نشد", 67 67 notFound: "این صفحه یا خصوصی است یا وجود ندارد", 68 + home: "بازگشت به صفحه اصلی", 68 69 }, 69 70 folderContent: { 70 71 folder: "پوشه",
+1
quartz/i18n/locales/fr-FR.ts
··· 65 65 error: { 66 66 title: "Introuvable", 67 67 notFound: "Cette page est soit privée, soit elle n'existe pas.", 68 + home: "Retour à la page d'accueil", 68 69 }, 69 70 folderContent: { 70 71 folder: "Dossier",
+1
quartz/i18n/locales/hu-HU.ts
··· 65 65 error: { 66 66 title: "Nem található", 67 67 notFound: "Ez a lap vagy privát vagy nem létezik.", 68 + home: "Vissza a kezdőlapra", 68 69 }, 69 70 folderContent: { 70 71 folder: "Mappa",
+1
quartz/i18n/locales/it-IT.ts
··· 65 65 error: { 66 66 title: "Non trovato", 67 67 notFound: "Questa pagina è privata o non esiste.", 68 + home: "Ritorna alla home page", 68 69 }, 69 70 folderContent: { 70 71 folder: "Cartella",
+1
quartz/i18n/locales/ja-JP.ts
··· 65 65 error: { 66 66 title: "Not Found", 67 67 notFound: "ページが存在しないか、非公開設定になっています。", 68 + home: "ホームページに戻る", 68 69 }, 69 70 folderContent: { 70 71 folder: "フォルダ",
+1
quartz/i18n/locales/ko-KR.ts
··· 65 65 error: { 66 66 title: "Not Found", 67 67 notFound: "페이지가 존재하지 않거나 비공개 설정이 되어 있습니다.", 68 + home: "홈페이지로 돌아가기", 68 69 }, 69 70 folderContent: { 70 71 folder: "폴더",
+1
quartz/i18n/locales/nl-NL.ts
··· 66 66 error: { 67 67 title: "Niet gevonden", 68 68 notFound: "Deze pagina is niet zichtbaar of bestaat niet.", 69 + home: "Keer terug naar de start pagina", 69 70 }, 70 71 folderContent: { 71 72 folder: "Map",
+1
quartz/i18n/locales/pl-PL.ts
··· 65 65 error: { 66 66 title: "Nie znaleziono", 67 67 notFound: "Ta strona jest prywatna lub nie istnieje.", 68 + home: "Powrót do strony głównej", 68 69 }, 69 70 folderContent: { 70 71 folder: "Folder",
+1
quartz/i18n/locales/pt-BR.ts
··· 65 65 error: { 66 66 title: "Não encontrado", 67 67 notFound: "Esta página é privada ou não existe.", 68 + home: "Retornar a página inicial", 68 69 }, 69 70 folderContent: { 70 71 folder: "Arquivo",
+1
quartz/i18n/locales/ro-RO.ts
··· 66 66 error: { 67 67 title: "Pagina nu a fost găsită", 68 68 notFound: "Fie această pagină este privată, fie nu există.", 69 + home: "Reveniți la pagina de pornire", 69 70 }, 70 71 folderContent: { 71 72 folder: "Dosar",
+1
quartz/i18n/locales/ru-RU.ts
··· 67 67 error: { 68 68 title: "Страница не найдена", 69 69 notFound: "Эта страница приватная или не существует", 70 + home: "Вернуться на главную страницу", 70 71 }, 71 72 folderContent: { 72 73 folder: "Папка",
+1
quartz/i18n/locales/uk-UA.ts
··· 65 65 error: { 66 66 title: "Не знайдено", 67 67 notFound: "Ця сторінка або приватна, або не існує.", 68 + home: "Повернутися на головну сторінку", 68 69 }, 69 70 folderContent: { 70 71 folder: "Папка",
+1
quartz/i18n/locales/vi-VN.ts
··· 65 65 error: { 66 66 title: "Không Tìm Thấy", 67 67 notFound: "Trang này được bảo mật hoặc không tồn tại.", 68 + home: "Trở về trang chủ", 68 69 }, 69 70 folderContent: { 70 71 folder: "Thư Mục",
+1
quartz/i18n/locales/zh-CN.ts
··· 65 65 error: { 66 66 title: "无法找到", 67 67 notFound: "私有笔记或笔记不存在。", 68 + home: "返回首页", 68 69 }, 69 70 folderContent: { 70 71 folder: "文件夹",