first commit
This commit is contained in:
31
apps/docs/lib/navigation.ts
Normal file
31
apps/docs/lib/navigation.ts
Normal file
@@ -0,0 +1,31 @@
|
||||
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', group: 'Интеграция' },
|
||||
{ slug: 'ldap', title: 'LDAP / LDAPS', group: 'Интеграция' },
|
||||
{ slug: 'sessions', title: 'Сессии и PIN', group: 'Безопасность' },
|
||||
{ slug: 'family-chat', title: 'Семья и чат', 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());
|
||||
}
|
||||
Reference in New Issue
Block a user