@ampernic/vitepress-theme-alt-docs 0.1.20 → 0.1.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -18,10 +18,9 @@ interface DistroInfo {
18
18
  title?: string
19
19
  }
20
20
 
21
- interface SectionInfo {
22
- name: string
23
- distros: string[]
24
- }
21
+ type SectionInfo =
22
+ | { name: string; distros: string[]; distro?: never }
23
+ | { name: string; distro: string; distros?: never }
25
24
 
26
25
  declare const __VERSIONS_DATA__: {
27
26
  distros: { [distroName: string]: DistroInfo }
@@ -103,6 +102,7 @@ const shouldShowMenu = computed(() => availableProducts.value.length > 0)
103
102
 
104
103
  const PRODUCT_NAMES: Record<string, string> = {
105
104
  'alt-domain': 'Альт Домен',
105
+ 'alt-domain-p10': 'Альт Домен (p10)',
106
106
  'alt-education': 'Альт Образование',
107
107
  'alt-education-e2k': 'Альт Образование для Эльбрус',
108
108
  'alt-server': 'Альт Сервер',
@@ -112,12 +112,16 @@ const PRODUCT_NAMES: Record<string, string> = {
112
112
  'alt-workstation-e2k': 'Альт Рабочая станция для Эльбрус',
113
113
  'alt-kworkstation': 'Альт Рабочая станция K',
114
114
  'alt-platform': 'Альт Платформа',
115
+ 'alt-platform-practic': 'Альт Платформа Практик',
115
116
  'alt-mobile': 'Альт Мобильный',
116
117
  'alt-virtualisation-one': 'Альт Виртуализация ONE',
117
118
  'alt-virtualization-pve': 'Альт Виртуализация PVE',
118
119
  'simply-linux': 'Симпли Линукс',
119
120
  'simply-linux-e2k': 'Симпли Линукс для Эльбрус',
120
- 'group-policy': 'Групповые политики',
121
+ 'alt-admin': 'Администрирование Альт',
122
+ 'freeipa-p10': 'FreeIPA (p10)',
123
+ 'freeipa-p11': 'FreeIPA (p11)',
124
+ 'Nets-Laboratories': 'Лабораторные работы',
121
125
  }
122
126
 
123
127
  const formatProductName = (name: string): string =>
@@ -169,7 +173,9 @@ const makeProductItem = (product: string) => {
169
173
 
170
174
  const menuGroupItem = computed((): DefaultTheme.NavItemWithChildren => {
171
175
  const sections = versionsData.sections ?? []
172
- const sectionedDistros = new Set(sections.flatMap((s) => s.distros))
176
+ const sectionedDistros = new Set(
177
+ sections.flatMap((s) => ('distros' in s && s.distros ? s.distros : [s.distro!])),
178
+ )
173
179
 
174
180
  const unsectioned = availableProducts.value.filter((p) => !sectionedDistros.has(p))
175
181
  const regular = unsectioned.filter((p) => !p.endsWith('-e2k'))
@@ -178,7 +184,18 @@ const menuGroupItem = computed((): DefaultTheme.NavItemWithChildren => {
178
184
  const items: DefaultTheme.NavItemWithChildren['items'] = regular.map(makeProductItem)
179
185
 
180
186
  for (const section of sections) {
181
- const sectionDistros = section.distros.filter((d) => availableProducts.value.includes(d))
187
+ if ('distro' in section && section.distro) {
188
+ // Flat top-level entry: render as a single link with the section name as
189
+ // its display text instead of the auto-derived product name.
190
+ if (availableProducts.value.includes(section.distro)) {
191
+ const item = makeProductItem(section.distro)
192
+ items.push({ ...item, text: section.name })
193
+ }
194
+ continue
195
+ }
196
+ const sectionDistros = (section.distros ?? []).filter((d) =>
197
+ availableProducts.value.includes(d),
198
+ )
182
199
  if (sectionDistros.length > 0) {
183
200
  items.push({ text: section.name, items: sectionDistros.map(makeProductItem) })
184
201
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampernic/vitepress-theme-alt-docs",
3
- "version": "0.1.20",
3
+ "version": "0.1.21",
4
4
  "description": "Shared VitePress theme for ALT Linux documentation",
5
5
  "license": "GPL-3.0-or-later",
6
6
  "author": "Ampernic",
@@ -27,17 +27,17 @@
27
27
  "peerDependencies": {
28
28
  "vitepress": "^1.0.0",
29
29
  "vue": "^3.0.0",
30
- "@ampernic/vitepress-plugin-export": "^0.1.23"
30
+ "@ampernic/vitepress-plugin-export": "^0.1.35"
31
31
  },
32
32
  "dependencies": {
33
33
  "@alt-gnome/markdown-it-custom-containers": "^1.0.0",
34
34
  "@nolebase/vitepress-plugin-enhanced-readabilities": "^2.14.0",
35
35
  "markdown-it-kbd": "^1.0.0",
36
36
  "vitepress-plugin-tabs": "^0.6.0",
37
- "@ampernic/vitepress-plugin-alt-docs-versioning": "0.1.5",
38
- "@ampernic/vitepress-plugin-pagefind": "0.1.8",
39
37
  "@ampernic/vitepress-plugin-html-image": "0.1.2",
40
- "@ampernic/vitepress-plugin-cross-site-router": "0.1.2"
38
+ "@ampernic/vitepress-plugin-cross-site-router": "0.1.2",
39
+ "@ampernic/vitepress-plugin-alt-docs-versioning": "0.1.6",
40
+ "@ampernic/vitepress-plugin-pagefind": "0.1.8"
41
41
  },
42
42
  "devDependencies": {
43
43
  "builtin-modules": "^3.3.0",