feat(help): embed the TREK wiki as an in-app help centre

Add a Help section (profile menu, /help) that renders the GitHub wiki inside
TREK. /api/help fetches the wiki markdown — the nav from _Sidebar.md, pages,
and proxied images — from GitHub and caches it (1h TTL, serves stale on
outage), so it auto-syncs on wiki edits with no redeploy and the client never
calls GitHub directly. The page is styled to match TREK with a section
sidebar, search and react-markdown; wiki [[links]] are rewritten to in-app
routes and HTML-comment placeholders are stripped. Page state lives in a
useHelp() hook per the page pattern. Adds nav.help and a help namespace
across all locales.
This commit is contained in:
Maurice
2026-06-29 18:24:49 +02:00
committed by Maurice
parent 1cc69fc22a
commit e91f592f22
73 changed files with 860 additions and 3 deletions
+13
View File
@@ -0,0 +1,13 @@
import type { TranslationStrings } from '../types';
// English fallback until 'ar' is translated.
const help: TranslationStrings = {
'help.title': "Help & Docs",
'help.search': "Search docs…",
'help.contents': "Contents",
'help.noResults': "No matching pages.",
'help.errorTitle': "Couldn't load this page",
'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.",
};
export default help;
+2
View File
@@ -39,6 +39,7 @@ import trip from './trip';
import trips from './trips';
import undo from './undo';
import vacay from './vacay';
import help from './help';
const locale = {
...common,
@@ -82,5 +83,6 @@ const locale = {
...oauth,
...system_notice,
...transport,
...help,
};
export default locale;
+1
View File
@@ -16,5 +16,6 @@ const nav: TranslationStrings = {
'nav.bottomAdmin': 'إعدادات المسؤول',
'nav.bottomLogout': 'تسجيل الخروج',
'nav.bottomAdminBadge': 'مسؤول',
'nav.help': 'Help',
};
export default nav;
+13
View File
@@ -0,0 +1,13 @@
import type { TranslationStrings } from '../types';
// English fallback until 'br' is translated.
const help: TranslationStrings = {
'help.title': "Help & Docs",
'help.search': "Search docs…",
'help.contents': "Contents",
'help.noResults': "No matching pages.",
'help.errorTitle': "Couldn't load this page",
'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.",
};
export default help;
+2
View File
@@ -39,6 +39,7 @@ import trip from './trip';
import trips from './trips';
import undo from './undo';
import vacay from './vacay';
import help from './help';
const locale = {
...common,
@@ -82,5 +83,6 @@ const locale = {
...oauth,
...system_notice,
...transport,
...help,
};
export default locale;
+1
View File
@@ -16,5 +16,6 @@ const nav: TranslationStrings = {
'nav.bottomAdmin': 'Administração',
'nav.bottomLogout': 'Sair',
'nav.bottomAdminBadge': 'Admin',
'nav.help': 'Help',
};
export default nav;
+13
View File
@@ -0,0 +1,13 @@
import type { TranslationStrings } from '../types';
// English fallback until 'cs' is translated.
const help: TranslationStrings = {
'help.title': "Help & Docs",
'help.search': "Search docs…",
'help.contents': "Contents",
'help.noResults': "No matching pages.",
'help.errorTitle': "Couldn't load this page",
'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.",
};
export default help;
+2
View File
@@ -39,6 +39,7 @@ import trip from './trip';
import trips from './trips';
import undo from './undo';
import vacay from './vacay';
import help from './help';
const locale = {
...common,
@@ -82,5 +83,6 @@ const locale = {
...oauth,
...system_notice,
...transport,
...help,
};
export default locale;
+1
View File
@@ -16,5 +16,6 @@ const nav: TranslationStrings = {
'nav.bottomAdmin': 'Nastavení správce',
'nav.bottomLogout': 'Odhlásit se',
'nav.bottomAdminBadge': 'Správce',
'nav.help': 'Help',
};
export default nav;
+13
View File
@@ -0,0 +1,13 @@
import type { TranslationStrings } from '../types';
const help: TranslationStrings = {
'help.title': 'Hilfe & Doku',
'help.search': 'Doku durchsuchen…',
'help.contents': 'Inhalt',
'help.noResults': 'Keine passenden Seiten.',
'help.errorTitle': 'Seite konnte nicht geladen werden',
'help.errorBody':
'Die Hilfe-Inhalte kommen aus dem TREK-Wiki. Prüfe deine Verbindung und versuch es erneut.',
};
export default help;
+2
View File
@@ -39,6 +39,7 @@ import trip from './trip';
import trips from './trips';
import undo from './undo';
import vacay from './vacay';
import help from './help';
const locale = {
...common,
@@ -82,5 +83,6 @@ const locale = {
...oauth,
...system_notice,
...transport,
...help,
};
export default locale;
+1
View File
@@ -16,5 +16,6 @@ const nav: TranslationStrings = {
'nav.bottomAdmin': 'Admin-Einstellungen',
'nav.bottomLogout': 'Abmelden',
'nav.bottomAdminBadge': 'Admin',
'nav.help': 'Hilfe',
};
export default nav;
+13
View File
@@ -0,0 +1,13 @@
import type { TranslationStrings } from '../types';
const help: TranslationStrings = {
'help.title': 'Help & Docs',
'help.search': 'Search docs…',
'help.contents': 'Contents',
'help.noResults': 'No matching pages.',
'help.errorTitle': "Couldn't load this page",
'help.errorBody':
'The help content is fetched from the TREK wiki. Check your connection and try again.',
};
export default help;
+2
View File
@@ -39,6 +39,7 @@ import trip from './trip';
import trips from './trips';
import undo from './undo';
import vacay from './vacay';
import help from './help';
const locale = {
...common,
@@ -82,5 +83,6 @@ const locale = {
...oauth,
...system_notice,
...transport,
...help,
};
export default locale;
+1
View File
@@ -16,5 +16,6 @@ const nav: TranslationStrings = {
'nav.bottomAdmin': 'Admin Settings',
'nav.bottomLogout': 'Logout',
'nav.bottomAdminBadge': 'Admin',
'nav.help': 'Help',
};
export default nav;
+13
View File
@@ -0,0 +1,13 @@
import type { TranslationStrings } from '../types';
// English fallback until 'es' is translated.
const help: TranslationStrings = {
'help.title': "Help & Docs",
'help.search': "Search docs…",
'help.contents': "Contents",
'help.noResults': "No matching pages.",
'help.errorTitle': "Couldn't load this page",
'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.",
};
export default help;
+2
View File
@@ -39,6 +39,7 @@ import trip from './trip';
import trips from './trips';
import undo from './undo';
import vacay from './vacay';
import help from './help';
const locale = {
...common,
@@ -82,5 +83,6 @@ const locale = {
...oauth,
...system_notice,
...transport,
...help,
};
export default locale;
+1
View File
@@ -16,5 +16,6 @@ const nav: TranslationStrings = {
'nav.bottomAdmin': 'Administración',
'nav.bottomLogout': 'Cerrar sesión',
'nav.bottomAdminBadge': 'Admin',
'nav.help': 'Help',
};
export default nav;
+13
View File
@@ -0,0 +1,13 @@
import type { TranslationStrings } from '../types';
// English fallback until 'fr' is translated.
const help: TranslationStrings = {
'help.title': "Help & Docs",
'help.search': "Search docs…",
'help.contents': "Contents",
'help.noResults': "No matching pages.",
'help.errorTitle': "Couldn't load this page",
'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.",
};
export default help;
+2
View File
@@ -39,6 +39,7 @@ import trip from './trip';
import trips from './trips';
import undo from './undo';
import vacay from './vacay';
import help from './help';
const locale = {
...common,
@@ -82,5 +83,6 @@ const locale = {
...oauth,
...system_notice,
...transport,
...help,
};
export default locale;
+1
View File
@@ -16,5 +16,6 @@ const nav: TranslationStrings = {
'nav.bottomAdmin': 'Administration',
'nav.bottomLogout': 'Déconnexion',
'nav.bottomAdminBadge': 'Admin',
'nav.help': 'Help',
};
export default nav;
+13
View File
@@ -0,0 +1,13 @@
import type { TranslationStrings } from '../types';
// English fallback until 'gr' is translated.
const help: TranslationStrings = {
'help.title': "Help & Docs",
'help.search': "Search docs…",
'help.contents': "Contents",
'help.noResults': "No matching pages.",
'help.errorTitle': "Couldn't load this page",
'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.",
};
export default help;
+2
View File
@@ -39,6 +39,7 @@ import trip from './trip';
import trips from './trips';
import undo from './undo';
import vacay from './vacay';
import help from './help';
const locale = {
...common,
@@ -82,5 +83,6 @@ const locale = {
...oauth,
...system_notice,
...transport,
...help,
};
export default locale;
+1
View File
@@ -16,5 +16,6 @@ const nav: TranslationStrings = {
'nav.bottomAdmin': 'Ρυθμίσεις Διαχειριστή',
'nav.bottomLogout': 'Αποσύνδεση',
'nav.bottomAdminBadge': 'Διαχειριστής',
'nav.help': 'Help',
};
export default nav;
+13
View File
@@ -0,0 +1,13 @@
import type { TranslationStrings } from '../types';
// English fallback until 'hu' is translated.
const help: TranslationStrings = {
'help.title': "Help & Docs",
'help.search': "Search docs…",
'help.contents': "Contents",
'help.noResults': "No matching pages.",
'help.errorTitle': "Couldn't load this page",
'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.",
};
export default help;
+2
View File
@@ -39,6 +39,7 @@ import trip from './trip';
import trips from './trips';
import undo from './undo';
import vacay from './vacay';
import help from './help';
const locale = {
...common,
@@ -82,5 +83,6 @@ const locale = {
...oauth,
...system_notice,
...transport,
...help,
};
export default locale;
+1
View File
@@ -16,5 +16,6 @@ const nav: TranslationStrings = {
'nav.bottomAdmin': 'Adminisztráció',
'nav.bottomLogout': 'Kijelentkezés',
'nav.bottomAdminBadge': 'Admin',
'nav.help': 'Help',
};
export default nav;
+13
View File
@@ -0,0 +1,13 @@
import type { TranslationStrings } from '../types';
// English fallback until 'id' is translated.
const help: TranslationStrings = {
'help.title': "Help & Docs",
'help.search': "Search docs…",
'help.contents': "Contents",
'help.noResults': "No matching pages.",
'help.errorTitle': "Couldn't load this page",
'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.",
};
export default help;
+2
View File
@@ -39,6 +39,7 @@ import trip from './trip';
import trips from './trips';
import undo from './undo';
import vacay from './vacay';
import help from './help';
const locale = {
...common,
@@ -82,5 +83,6 @@ const locale = {
...oauth,
...system_notice,
...transport,
...help,
};
export default locale;
+1
View File
@@ -16,5 +16,6 @@ const nav: TranslationStrings = {
'nav.bottomAdmin': 'Pengaturan Admin',
'nav.bottomLogout': 'Keluar',
'nav.bottomAdminBadge': 'Admin',
'nav.help': 'Help',
};
export default nav;
+13
View File
@@ -0,0 +1,13 @@
import type { TranslationStrings } from '../types';
// English fallback until 'it' is translated.
const help: TranslationStrings = {
'help.title': "Help & Docs",
'help.search': "Search docs…",
'help.contents': "Contents",
'help.noResults': "No matching pages.",
'help.errorTitle': "Couldn't load this page",
'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.",
};
export default help;
+2
View File
@@ -39,6 +39,7 @@ import trip from './trip';
import trips from './trips';
import undo from './undo';
import vacay from './vacay';
import help from './help';
const locale = {
...common,
@@ -82,5 +83,6 @@ const locale = {
...oauth,
...system_notice,
...transport,
...help,
};
export default locale;
+1
View File
@@ -16,5 +16,6 @@ const nav: TranslationStrings = {
'nav.bottomAdmin': 'Amministrazione',
'nav.bottomLogout': 'Disconnetti',
'nav.bottomAdminBadge': 'Admin',
'nav.help': 'Help',
};
export default nav;
+13
View File
@@ -0,0 +1,13 @@
import type { TranslationStrings } from '../types';
// English fallback until 'ja' is translated.
const help: TranslationStrings = {
'help.title': "Help & Docs",
'help.search': "Search docs…",
'help.contents': "Contents",
'help.noResults': "No matching pages.",
'help.errorTitle': "Couldn't load this page",
'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.",
};
export default help;
+2
View File
@@ -39,6 +39,7 @@ import trip from './trip';
import trips from './trips';
import undo from './undo';
import vacay from './vacay';
import help from './help';
const locale = {
...common,
@@ -82,5 +83,6 @@ const locale = {
...oauth,
...system_notice,
...transport,
...help,
};
export default locale;
+1
View File
@@ -16,5 +16,6 @@ const nav: TranslationStrings = {
'nav.bottomAdmin': '管理者設定',
'nav.bottomLogout': 'ログアウト',
'nav.bottomAdminBadge': '管理者',
'nav.help': 'Help',
};
export default nav;
+13
View File
@@ -0,0 +1,13 @@
import type { TranslationStrings } from '../types';
// English fallback until 'ko' is translated.
const help: TranslationStrings = {
'help.title': "Help & Docs",
'help.search': "Search docs…",
'help.contents': "Contents",
'help.noResults': "No matching pages.",
'help.errorTitle': "Couldn't load this page",
'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.",
};
export default help;
+2
View File
@@ -39,6 +39,7 @@ import trip from './trip';
import trips from './trips';
import undo from './undo';
import vacay from './vacay';
import help from './help';
const locale = {
...common,
@@ -82,5 +83,6 @@ const locale = {
...oauth,
...system_notice,
...transport,
...help,
};
export default locale;
+1
View File
@@ -16,5 +16,6 @@ const nav: TranslationStrings = {
'nav.bottomAdmin': '관리자 설정',
'nav.bottomLogout': '로그아웃',
'nav.bottomAdminBadge': '관리자',
'nav.help': 'Help',
};
export default nav;
+13
View File
@@ -0,0 +1,13 @@
import type { TranslationStrings } from '../types';
// English fallback until 'nl' is translated.
const help: TranslationStrings = {
'help.title': "Help & Docs",
'help.search': "Search docs…",
'help.contents': "Contents",
'help.noResults': "No matching pages.",
'help.errorTitle': "Couldn't load this page",
'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.",
};
export default help;
+2
View File
@@ -39,6 +39,7 @@ import trip from './trip';
import trips from './trips';
import undo from './undo';
import vacay from './vacay';
import help from './help';
const locale = {
...common,
@@ -82,5 +83,6 @@ const locale = {
...oauth,
...system_notice,
...transport,
...help,
};
export default locale;
+1
View File
@@ -16,5 +16,6 @@ const nav: TranslationStrings = {
'nav.bottomAdmin': 'Beheerdersinstellingen',
'nav.bottomLogout': 'Uitloggen',
'nav.bottomAdminBadge': 'Beheerder',
'nav.help': 'Help',
};
export default nav;
+13
View File
@@ -0,0 +1,13 @@
import type { TranslationStrings } from '../types';
// English fallback until 'pl' is translated.
const help: TranslationStrings = {
'help.title': "Help & Docs",
'help.search': "Search docs…",
'help.contents': "Contents",
'help.noResults': "No matching pages.",
'help.errorTitle': "Couldn't load this page",
'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.",
};
export default help;
+2
View File
@@ -39,6 +39,7 @@ import trip from './trip';
import trips from './trips';
import undo from './undo';
import vacay from './vacay';
import help from './help';
const locale = {
...common,
@@ -82,5 +83,6 @@ const locale = {
...oauth,
...system_notice,
...transport,
...help,
};
export default locale;
+1
View File
@@ -16,5 +16,6 @@ const nav: TranslationStrings = {
'nav.bottomAdmin': 'Ustawienia administratora',
'nav.bottomLogout': 'Wyloguj się',
'nav.bottomAdminBadge': 'Administrator',
'nav.help': 'Help',
};
export default nav;
+13
View File
@@ -0,0 +1,13 @@
import type { TranslationStrings } from '../types';
// English fallback until 'ru' is translated.
const help: TranslationStrings = {
'help.title': "Help & Docs",
'help.search': "Search docs…",
'help.contents': "Contents",
'help.noResults': "No matching pages.",
'help.errorTitle': "Couldn't load this page",
'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.",
};
export default help;
+2
View File
@@ -39,6 +39,7 @@ import trip from './trip';
import trips from './trips';
import undo from './undo';
import vacay from './vacay';
import help from './help';
const locale = {
...common,
@@ -82,5 +83,6 @@ const locale = {
...oauth,
...system_notice,
...transport,
...help,
};
export default locale;
+1
View File
@@ -16,5 +16,6 @@ const nav: TranslationStrings = {
'nav.bottomAdmin': 'Администрирование',
'nav.bottomLogout': 'Выйти',
'nav.bottomAdminBadge': 'Админ',
'nav.help': 'Help',
};
export default nav;
+13
View File
@@ -0,0 +1,13 @@
import type { TranslationStrings } from '../types';
// English fallback until 'sv' is translated.
const help: TranslationStrings = {
'help.title': "Help & Docs",
'help.search': "Search docs…",
'help.contents': "Contents",
'help.noResults': "No matching pages.",
'help.errorTitle': "Couldn't load this page",
'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.",
};
export default help;
+2
View File
@@ -39,6 +39,7 @@ import trip from './trip';
import trips from './trips';
import undo from './undo';
import vacay from './vacay';
import help from './help';
const locale = {
...common,
@@ -82,5 +83,6 @@ const locale = {
...oauth,
...system_notice,
...transport,
...help,
};
export default locale;
+1
View File
@@ -16,5 +16,6 @@ const nav: TranslationStrings = {
'nav.bottomAdmin': 'Admin Inställningar',
'nav.bottomLogout': 'Logga ut',
'nav.bottomAdminBadge': 'Admin',
'nav.help': 'Help',
};
export default nav;
+13
View File
@@ -0,0 +1,13 @@
import type { TranslationStrings } from '../types';
// English fallback until 'tr' is translated.
const help: TranslationStrings = {
'help.title': "Help & Docs",
'help.search': "Search docs…",
'help.contents': "Contents",
'help.noResults': "No matching pages.",
'help.errorTitle': "Couldn't load this page",
'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.",
};
export default help;
+2
View File
@@ -39,6 +39,7 @@ import trip from './trip';
import trips from './trips';
import undo from './undo';
import vacay from './vacay';
import help from './help';
const locale = {
...common,
@@ -82,5 +83,6 @@ const locale = {
...oauth,
...system_notice,
...transport,
...help,
};
export default locale;
+1
View File
@@ -16,5 +16,6 @@ const nav: TranslationStrings = {
'nav.bottomAdmin': 'Yönetici Ayarları',
'nav.bottomLogout': 'Çıkış',
'nav.bottomAdminBadge': 'Yönetici',
'nav.help': 'Help',
};
export default nav;
+13
View File
@@ -0,0 +1,13 @@
import type { TranslationStrings } from '../types';
// English fallback until 'uk' is translated.
const help: TranslationStrings = {
'help.title': "Help & Docs",
'help.search': "Search docs…",
'help.contents': "Contents",
'help.noResults': "No matching pages.",
'help.errorTitle': "Couldn't load this page",
'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.",
};
export default help;
+2
View File
@@ -39,6 +39,7 @@ import trip from './trip';
import trips from './trips';
import undo from './undo';
import vacay from './vacay';
import help from './help';
const locale = {
...common,
@@ -82,5 +83,6 @@ const locale = {
...oauth,
...system_notice,
...transport,
...help,
};
export default locale;
+1
View File
@@ -16,5 +16,6 @@ const nav: TranslationStrings = {
'nav.bottomAdmin': 'Адміністрування',
'nav.bottomLogout': 'Вийти',
'nav.bottomAdminBadge': 'Адмін',
'nav.help': 'Help',
};
export default nav;
+13
View File
@@ -0,0 +1,13 @@
import type { TranslationStrings } from '../types';
// English fallback until 'zh-TW' is translated.
const help: TranslationStrings = {
'help.title': "Help & Docs",
'help.search': "Search docs…",
'help.contents': "Contents",
'help.noResults': "No matching pages.",
'help.errorTitle': "Couldn't load this page",
'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.",
};
export default help;
+2
View File
@@ -39,6 +39,7 @@ import trip from './trip';
import trips from './trips';
import undo from './undo';
import vacay from './vacay';
import help from './help';
const locale = {
...common,
@@ -82,5 +83,6 @@ const locale = {
...oauth,
...system_notice,
...transport,
...help,
};
export default locale;
+1
View File
@@ -16,5 +16,6 @@ const nav: TranslationStrings = {
'nav.bottomAdmin': '管理設定',
'nav.bottomLogout': '退出登入',
'nav.bottomAdminBadge': '管理員',
'nav.help': 'Help',
};
export default nav;
+13
View File
@@ -0,0 +1,13 @@
import type { TranslationStrings } from '../types';
// English fallback until 'zh' is translated.
const help: TranslationStrings = {
'help.title': "Help & Docs",
'help.search': "Search docs…",
'help.contents': "Contents",
'help.noResults': "No matching pages.",
'help.errorTitle': "Couldn't load this page",
'help.errorBody': "The help content is fetched from the TREK wiki. Check your connection and try again.",
};
export default help;
+2
View File
@@ -39,6 +39,7 @@ import trip from './trip';
import trips from './trips';
import undo from './undo';
import vacay from './vacay';
import help from './help';
const locale = {
...common,
@@ -82,5 +83,6 @@ const locale = {
...oauth,
...system_notice,
...transport,
...help,
};
export default locale;
+1
View File
@@ -16,5 +16,6 @@ const nav: TranslationStrings = {
'nav.bottomAdmin': '管理设置',
'nav.bottomLogout': '退出登录',
'nav.bottomAdminBadge': '管理员',
'nav.help': 'Help',
};
export default nav;