-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsidebars.ts
More file actions
75 lines (72 loc) · 1.96 KB
/
sidebars.ts
File metadata and controls
75 lines (72 loc) · 1.96 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
import type { SidebarsConfig } from "@docusaurus/plugin-content-docs";
const generatedApiSidebar = require("./docs/api/sidebar.ts").default as any[];
const analyticsOrder = [
"api/obtener-analitica-del-proyecto",
"api/listar-conversaciones-del-proyecto",
"api/obtener-detalle-de-una-conversacion",
"api/registrar-evento-analitico",
];
const analyticsOrderIndex = new Map(
analyticsOrder.map((id, index) => [id, index]),
);
const orderedApiSidebar = generatedApiSidebar.map((item) =>
item.type === "category" && item.link?.id === "api/analytics"
? {
...item,
items: [...item.items].sort((a: any, b: any) => {
const aIndex = analyticsOrderIndex.get(a.id) ?? Number.MAX_SAFE_INTEGER;
const bIndex = analyticsOrderIndex.get(b.id) ?? Number.MAX_SAFE_INTEGER;
return aIndex - bIndex;
}),
}
: item,
);
const sidebars: SidebarsConfig = {
docsSidebar: [
"intro",
"what-is-aifindr",
"how-it-works",
{
type: "category",
label: "Cómo se integra",
customProps: {
icon: "Plug01Icon",
},
link: {
type: "doc",
id: "integration",
},
items: [
{
type: "category",
label: "Widget",
items: [
"widget-config/intro",
"widget-config/instalacion",
"widget-config/personalizacion",
"widget-config/contexto-metadatos",
"widget-config/javascript-api",
"widget-config/events-triggers",
{
type: "category",
label: "Integraciones",
items: [
{
type: "autogenerated",
dirName: "widget-config/integraciones",
},
],
},
],
},
{
type: "category",
label: "API",
items: orderedApiSidebar,
},
],
},
"security",
],
};
export default sidebars;