33 lines
1.4 KiB
TypeScript
33 lines
1.4 KiB
TypeScript
export interface DocNavItem {
|
|
slug: string;
|
|
title: string;
|
|
group: string;
|
|
}
|
|
|
|
export const docNavigation: DocNavItem[] = [
|
|
{ slug: 'getting-started', title: 'Начало работы', group: 'Введение' },
|
|
{ slug: 'architecture', title: 'Архитектура', group: 'Введение' },
|
|
{ slug: 'deployment', title: 'Развёртывание на сервере', group: 'Введение' },
|
|
{ slug: 'authentication', title: 'Аутентификация', group: 'Интеграция' },
|
|
{ slug: 'oauth', title: 'OAuth 2.0 / OIDC', group: 'Интеграция' },
|
|
{ slug: 'ldap', title: 'LDAP / LDAPS', group: 'Интеграция' },
|
|
{ slug: 'sessions', title: 'Сессии, PIN и удаление аккаунта', group: 'Безопасность' },
|
|
{ slug: 'family-chat', title: 'Семья и чат', group: 'Функции' },
|
|
{ slug: 'bot-api', title: 'Telegram Bot API', group: 'Интеграция' },
|
|
{ slug: 'api-reference', title: 'Справочник API', group: 'Справочник' }
|
|
];
|
|
|
|
export function getDocNavItem(slug: string) {
|
|
return docNavigation.find((item) => item.slug === slug);
|
|
}
|
|
|
|
export function groupDocNavigation(items: DocNavItem[]) {
|
|
const groups = new Map<string, DocNavItem[]>();
|
|
for (const item of items) {
|
|
const list = groups.get(item.group) ?? [];
|
|
list.push(item);
|
|
groups.set(item.group, list);
|
|
}
|
|
return Array.from(groups.entries());
|
|
}
|