Skip to content

Commit 302b757

Browse files
committed
refactor(sidebar): simplify sidebar item structure by removing docFooterText
- Updated sidebar item mapping to eliminate unnecessary docFooterText property. - Adjusted related documentation links in ms3favorites to reflect changes.
1 parent ab5c6ed commit 302b757

2 files changed

Lines changed: 12 additions & 16 deletions

File tree

.vitepress/theme/plugins/sidebar.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,16 @@ export default class DocsSidebar {
4747
items: DefaultTheme.SidebarItem[],
4848
path: string,
4949
): DefaultTheme.SidebarItem[] {
50-
items = items.map(({ text, link, items: subItems, docFooterText }) => {
50+
items = items.map(({ text, link, items }) => {
5151
const item: DefaultTheme.SidebarItem = { text }
5252

5353
if (link) {
5454
item.link = join(path, link).replace(/\\/g, '/')
5555
}
5656

57-
if (docFooterText) {
58-
item.docFooterText = docFooterText
59-
}
60-
61-
if (subItems) {
57+
if (items) {
6258
item.collapsed = true
63-
item.items = DocsSidebar.generateSidebarItem(subItems, path)
59+
item.items = DocsSidebar.generateSidebarItem(items, path)
6460
}
6561

6662
return item

docs/components/ms3favorites/index.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ items: [
1111
text: 'Сниппеты',
1212
link: 'snippets',
1313
items: [
14-
{ text: 'ms3Favorites', link: 'snippets/ms3Favorites', docFooterText: 'ms3Favorites' },
15-
{ text: 'ms3FavoritesBtn', link: 'snippets/ms3FavoritesBtn', docFooterText: 'ms3FavoritesBtn' },
16-
{ text: 'ms3FavoritesCounter', link: 'snippets/ms3FavoritesCounter', docFooterText: 'ms3FavoritesCounter' },
17-
{ text: 'ms3FavoritesIds', link: 'snippets/ms3FavoritesIds', docFooterText: 'ms3FavoritesIds' },
18-
{ text: 'ms3FavoritesPage', link: 'snippets/ms3FavoritesPage', docFooterText: 'ms3FavoritesPage' },
19-
{ text: 'ms3FavoritesLists', link: 'snippets/ms3FavoritesLists', docFooterText: 'ms3FavoritesLists' },
20-
{ text: 'ms3FavoritesPopularity', link: 'snippets/ms3FavoritesPopularity', docFooterText: 'ms3FavoritesPopularity' },
21-
{ text: 'ms3FavoritesShare', link: 'snippets/ms3FavoritesShare', docFooterText: 'ms3FavoritesShare' },
22-
{ text: 'ms3fLexiconScript', link: 'snippets/ms3fLexiconScript', docFooterText: 'ms3fLexiconScript' },
14+
{ text: 'ms3Favorites', link: 'snippets/ms3Favorites' },
15+
{ text: 'ms3FavoritesBtn', link: 'snippets/ms3FavoritesBtn' },
16+
{ text: 'ms3FavoritesCounter', link: 'snippets/ms3FavoritesCounter' },
17+
{ text: 'ms3FavoritesIds', link: 'snippets/ms3FavoritesIds' },
18+
{ text: 'ms3FavoritesPage', link: 'snippets/ms3FavoritesPage' },
19+
{ text: 'ms3FavoritesLists', link: 'snippets/ms3FavoritesLists' },
20+
{ text: 'ms3FavoritesPopularity', link: 'snippets/ms3FavoritesPopularity' },
21+
{ text: 'ms3FavoritesShare', link: 'snippets/ms3FavoritesShare' },
22+
{ text: 'ms3fLexiconScript', link: 'snippets/ms3fLexiconScript' },
2323
],
2424
},
2525
{ text: 'Подключение на сайте', link: 'frontend' },

0 commit comments

Comments
 (0)