|
| 1 | +import { defineConfig } from "vitepress"; |
| 2 | + |
| 3 | +export default defineConfig({ |
| 4 | + title: "STerm", |
| 5 | + description: "安全、顺手的跨平台 SSH / SFTP 终端", |
| 6 | + outDir: "../docs", |
| 7 | + base: "/sterm/", |
| 8 | + lastUpdated: true, |
| 9 | + cleanUrls: true, |
| 10 | + head: [["link", { rel: "icon", href: "/sterm/logo.svg" }]], |
| 11 | + themeConfig: { |
| 12 | + logo: "/logo.svg", |
| 13 | + socialLinks: [{ icon: "github", link: "https://github.com/while-coder/sterm" }], |
| 14 | + search: { |
| 15 | + provider: "local", |
| 16 | + options: { |
| 17 | + locales: { |
| 18 | + zh: { |
| 19 | + translations: { |
| 20 | + button: { buttonText: "搜索文档", buttonAriaLabel: "搜索文档" }, |
| 21 | + modal: { |
| 22 | + noResultsText: "没有找到相关内容", |
| 23 | + resetButtonTitle: "清除搜索", |
| 24 | + footer: { |
| 25 | + selectText: "选择", |
| 26 | + navigateText: "切换", |
| 27 | + closeText: "关闭", |
| 28 | + }, |
| 29 | + }, |
| 30 | + }, |
| 31 | + }, |
| 32 | + }, |
| 33 | + }, |
| 34 | + }, |
| 35 | + }, |
| 36 | + locales: { |
| 37 | + root: { |
| 38 | + label: "English", |
| 39 | + lang: "en-US", |
| 40 | + title: "STerm", |
| 41 | + description: "A secure, practical SSH and SFTP client", |
| 42 | + themeConfig: { |
| 43 | + nav: [ |
| 44 | + { text: "Guide", link: "/guide/getting-started" }, |
| 45 | + { text: "Download", link: "https://github.com/while-coder/sterm/releases" }, |
| 46 | + { text: "GitHub", link: "https://github.com/while-coder/sterm" }, |
| 47 | + ], |
| 48 | + sidebar: sidebar("en"), |
| 49 | + footer: { |
| 50 | + message: "Secure connections, files, and troubleshooting in one workspace.", |
| 51 | + copyright: "Copyright © STerm contributors", |
| 52 | + }, |
| 53 | + }, |
| 54 | + }, |
| 55 | + zh: { |
| 56 | + label: "简体中文", |
| 57 | + lang: "zh-CN", |
| 58 | + title: "STerm", |
| 59 | + description: "安全、顺手的跨平台 SSH / SFTP 终端", |
| 60 | + themeConfig: { |
| 61 | + nav: [ |
| 62 | + { text: "指南", link: "/zh/guide/getting-started" }, |
| 63 | + { text: "下载", link: "https://github.com/while-coder/sterm/releases" }, |
| 64 | + { text: "GitHub", link: "https://github.com/while-coder/sterm" }, |
| 65 | + ], |
| 66 | + sidebar: sidebar("zh"), |
| 67 | + docFooter: { prev: "上一页", next: "下一页" }, |
| 68 | + outline: { label: "本页目录" }, |
| 69 | + lastUpdated: { text: "最后更新于" }, |
| 70 | + darkModeSwitchLabel: "主题", |
| 71 | + lightModeSwitchTitle: "切换到浅色模式", |
| 72 | + darkModeSwitchTitle: "切换到深色模式", |
| 73 | + sidebarMenuLabel: "菜单", |
| 74 | + returnToTopLabel: "回到顶部", |
| 75 | + langMenuLabel: "切换语言", |
| 76 | + footer: { |
| 77 | + message: "把安全连接、文件管理和远程排查放在一个工作区里。", |
| 78 | + copyright: "Copyright © STerm contributors", |
| 79 | + }, |
| 80 | + }, |
| 81 | + }, |
| 82 | + }, |
| 83 | +}); |
| 84 | + |
| 85 | +function sidebar(locale: "en" | "zh") { |
| 86 | + const prefix = locale === "zh" ? "/zh" : ""; |
| 87 | + const text = locale === "zh" |
| 88 | + ? { |
| 89 | + intro: "开始使用", |
| 90 | + start: "快速开始", |
| 91 | + features: "功能指南", |
| 92 | + ssh: "SSH 与会话", |
| 93 | + sftp: "SFTP 文件管理", |
| 94 | + ai: "AI 终端助手", |
| 95 | + security: "安全与同步", |
| 96 | + } |
| 97 | + : { |
| 98 | + intro: "Introduction", |
| 99 | + start: "Getting Started", |
| 100 | + features: "Features", |
| 101 | + ssh: "SSH and Sessions", |
| 102 | + sftp: "SFTP File Management", |
| 103 | + ai: "AI Terminal Assistant", |
| 104 | + security: "Security and Sync", |
| 105 | + }; |
| 106 | + return [ |
| 107 | + { |
| 108 | + text: text.intro, |
| 109 | + items: [{ text: text.start, link: `${prefix}/guide/getting-started` }], |
| 110 | + }, |
| 111 | + { |
| 112 | + text: text.features, |
| 113 | + items: [ |
| 114 | + { text: text.ssh, link: `${prefix}/guide/ssh` }, |
| 115 | + { text: text.sftp, link: `${prefix}/guide/sftp` }, |
| 116 | + { text: text.ai, link: `${prefix}/guide/ai` }, |
| 117 | + { text: text.security, link: `${prefix}/guide/security-sync` }, |
| 118 | + ], |
| 119 | + }, |
| 120 | + ]; |
| 121 | +} |
0 commit comments