VitePress: Add activeMatch for nav menus

This commit is contained in:
Meow
2026-06-10 05:55:43 +08:00
parent 3d64d6dc7c
commit c562f835d3
3 changed files with 150 additions and 30 deletions
+49 -10
View File
@@ -4,26 +4,65 @@ export const nav: DefaultTheme.Config["nav"] = [
{ text: "Homepage", link: "/en" },
{
text: "Configuration Guide",
activeMatch: "^/en/config/",
items: [
{ text: "Feature Details", link: "/en/config/features/" },
{ text: "Basic Configuration", link: "/en/config/" },
{ text: "Inbound Protocols", link: "/en/config/inbounds/" },
{ text: "Outbound Protocols", link: "/en/config/outbounds/" },
{ text: "Transport Configuration", link: "/en/config/transports/" }
{
text: "Feature Details",
link: "/en/config/features/",
activeMatch: "^/en/config/features/"
},
{
text: "Basic Configuration",
link: "/en/config/",
activeMatch: "^/en/config/[^/]*$"
},
{
text: "Inbound Protocols",
link: "/en/config/inbounds/",
activeMatch: "^/en/config/inbounds/"
},
{
text: "Outbound Protocols",
link: "/en/config/outbounds/",
activeMatch: "^/en/config/outbounds/"
},
{
text: "Transport Configuration",
link: "/en/config/transports/",
activeMatch: "^/en/config/transports/"
}
]
},
{
text: "Usage Guide",
activeMatch: "^/en/document/",
items: [
{ text: "Quick Start", link: "/en/document/" },
{
text: "Quick Start",
link: "/en/document/",
activeMatch: "^/en/document/[^/]*$"
},
{
text: "Absolute Beginner's Plain Guide",
link: "/en/document/level-0/"
link: "/en/document/level-0/",
activeMatch: "^/en/document/level-0/"
},
{ text: "Beginner Skills", link: "/en/document/level-1/" },
{ text: "Advanced Skills", link: "/en/document/level-2/" }
{
text: "Beginner Skills",
link: "/en/document/level-1/",
activeMatch: "^/en/document/level-1/"
},
{
text: "Advanced Skills",
link: "/en/document/level-2/",
activeMatch: "^/en/document/level-2/"
}
]
},
{ text: "Developer Guide", link: "/en/development/" },
{
text: "Developer Guide",
link: "/en/development/",
activeMatch: "^/en/development/"
},
{ text: "Sponsor & Donation & NFTs", link: "/en/about/sponsor.md" }
]
+52 -10
View File
@@ -4,23 +4,65 @@ export const nav: DefaultTheme.Config["nav"] = [
{ text: "首页", link: "/" },
{
text: "配置指南",
activeMatch: "^/config/",
items: [
{ text: "特性详解", link: "/config/features/" },
{ text: "基础配置", link: "/config/" },
{ text: "入站协议", link: "/config/inbounds/" },
{ text: "出站协议", link: "/config/outbounds/" },
{ text: "传输配置", link: "/config/transports/" }
{
text: "特性详解",
link: "/config/features/",
activeMatch: "^/config/features/"
},
{
text: "基础配置",
link: "/config/",
activeMatch: "^/config/[^/]*$"
},
{
text: "入站协议",
link: "/config/inbounds/",
activeMatch: "^/config/inbounds/"
},
{
text: "出站协议",
link: "/config/outbounds/",
activeMatch: "^/config/outbounds/"
},
{
text: "传输配置",
link: "/config/transports/",
activeMatch: "^/config/transports/"
}
]
},
{
text: "使用指南",
activeMatch: "^/document/",
items: [
{ text: "快速入门", link: "/document/" },
{ text: "小小白白话文", link: "/document/level-0/" },
{ text: "入门技巧", link: "/document/level-1/" },
{ text: "进阶技巧", link: "/document/level-2/" }
{
text: "快速入门",
link: "/document/",
activeMatch: "^/document/[^/]*$"
},
{
text: "小小白白话文",
link: "/document/level-0/",
activeMatch: "^/document/level-0/"
},
{
text: "入门技巧",
link: "/document/level-1/",
activeMatch: "^/document/level-1/"
},
{
text: "进阶技巧",
link: "/document/level-2/",
activeMatch: "^/document/level-2/"
}
]
},
{ text: "开发指南", link: "/development/" },
{
text: "开发指南",
link: "/development/",
activeMatch: "^/development/"
},
{ text: "赞助 & 捐款 & NFTs", link: "/about/sponsor.md" }
]
+49 -10
View File
@@ -4,26 +4,65 @@ export const nav: DefaultTheme.Config["nav"] = [
{ text: "Главная", link: "/ru" },
{
text: "Описание функций",
activeMatch: "^/ru/config/",
items: [
{ text: "Обзор", link: "/ru/config/features/" },
{ text: "Базовая конфигурация", link: "/ru/config/" },
{ text: "Входящие подключения", link: "/ru/config/inbounds/" },
{ text: "Исходящие подключения", link: "/ru/config/outbounds/" },
{ text: "Конфигурация транспорта", link: "/ru/config/transports/" }
{
text: "Обзор",
link: "/ru/config/features/",
activeMatch: "^/ru/config/features/"
},
{
text: "Базовая конфигурация",
link: "/ru/config/",
activeMatch: "^/ru/config/[^/]*$"
},
{
text: "Входящие подключения",
link: "/ru/config/inbounds/",
activeMatch: "^/ru/config/inbounds/"
},
{
text: "Исходящие подключения",
link: "/ru/config/outbounds/",
activeMatch: "^/ru/config/outbounds/"
},
{
text: "Конфигурация транспорта",
link: "/ru/config/transports/",
activeMatch: "^/ru/config/transports/"
}
]
},
{
text: "Руководство по использованию",
activeMatch: "^/ru/document/",
items: [
{ text: "Быстрый старт", link: "/ru/document/" },
{
text: "Быстрый старт",
link: "/ru/document/",
activeMatch: "^/ru/document/[^/]*$"
},
{
text: "Простыми словами",
link: "/ru/document/level-0/"
link: "/ru/document/level-0/",
activeMatch: "^/ru/document/level-0/"
},
{ text: "Базовые навыки", link: "/ru/document/level-1/" },
{ text: "Продвинутые навыки", link: "/ru/document/level-2/" }
{
text: "Базовые навыки",
link: "/ru/document/level-1/",
activeMatch: "^/ru/document/level-1/"
},
{
text: "Продвинутые навыки",
link: "/ru/document/level-2/",
activeMatch: "^/ru/document/level-2/"
}
]
},
{ text: "Руководство разработчика", link: "/ru/development/" },
{
text: "Руководство разработчика",
link: "/ru/development/",
activeMatch: "^/ru/development/"
},
{ text: "Sponsor & Donation & NFTs", link: "/ru/about/sponsor.md" }
]