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