|
| 1 | +import { defineConfig } from 'vitepress' |
| 2 | + |
| 3 | +export default defineConfig({ |
| 4 | + title: 'eBPF Tutorial', |
| 5 | + description: 'Learn eBPF programming from scratch', |
| 6 | + base: '/ebpf-tutorial/', |
| 7 | + |
| 8 | + head: [ |
| 9 | + ['link', { rel: 'icon', href: '/ebpf-tutorial/favicon.ico' }] |
| 10 | + ], |
| 11 | + |
| 12 | + // 多语言配置 |
| 13 | + locales: { |
| 14 | + root: { |
| 15 | + label: 'English', |
| 16 | + lang: 'en', |
| 17 | + themeConfig: { |
| 18 | + nav: [ |
| 19 | + { text: 'Home', link: '/' }, |
| 20 | + { text: 'Guide', link: '/guide/lesson-1-helloworld' } |
| 21 | + ], |
| 22 | + sidebar: { |
| 23 | + '/guide/': [ |
| 24 | + { |
| 25 | + text: 'Getting Started', |
| 26 | + items: [ |
| 27 | + { text: 'Lesson 1: Hello World', link: '/guide/lesson-1-helloworld' } |
| 28 | + ] |
| 29 | + }, |
| 30 | + { |
| 31 | + text: 'Hook Mechanisms', |
| 32 | + items: [ |
| 33 | + { text: 'Lesson 2: Kprobe', link: '/guide/lesson-2-kprobe' }, |
| 34 | + { text: 'Lesson 3: Uprobe', link: '/guide/lesson-3-uprobe' }, |
| 35 | + { text: 'Lesson 8: Tracepoint', link: '/guide/lesson-8-tracepoint' }, |
| 36 | + { text: 'Lesson 9: Raw Tracepoint', link: '/guide/lesson-9-raw-tracepoint' } |
| 37 | + ] |
| 38 | + }, |
| 39 | + { |
| 40 | + text: 'Data Structures', |
| 41 | + items: [ |
| 42 | + { text: 'Lesson 4: User Map', link: '/guide/lesson-4-user-map' }, |
| 43 | + { text: 'Lesson 5: Kernel User Map', link: '/guide/lesson-5-kernel-user-map' }, |
| 44 | + { text: 'Lesson 7: Ring/Perf Buffer', link: '/guide/lesson-7-ringbuffer-perfbuffer' } |
| 45 | + ] |
| 46 | + }, |
| 47 | + { |
| 48 | + text: 'Network Programming', |
| 49 | + items: [ |
| 50 | + { text: 'Lesson 11: TC Ingress', link: '/guide/lesson-11-tc-ingress' }, |
| 51 | + { text: 'Lesson 12: TC Egress', link: '/guide/lesson-12-tc-egress' } |
| 52 | + ] |
| 53 | + }, |
| 54 | + { |
| 55 | + text: 'Advanced Topics', |
| 56 | + items: [ |
| 57 | + { text: 'Lesson 6: Go Development', link: '/guide/lesson-6-golang-develop' }, |
| 58 | + { text: 'Lesson 10: BTF', link: '/guide/lesson-10-btf' }, |
| 59 | + { text: 'Lesson 13: SSL Sniff', link: '/guide/lesson-13-ssl-sniff' } |
| 60 | + ] |
| 61 | + } |
| 62 | + ] |
| 63 | + } |
| 64 | + } |
| 65 | + }, |
| 66 | + zh: { |
| 67 | + label: '简体中文', |
| 68 | + lang: 'zh-CN', |
| 69 | + link: '/zh/', |
| 70 | + themeConfig: { |
| 71 | + nav: [ |
| 72 | + { text: '首页', link: '/zh/' }, |
| 73 | + { text: '教程', link: '/zh/guide/lesson-1-helloworld' } |
| 74 | + ], |
| 75 | + sidebar: { |
| 76 | + '/zh/guide/': [ |
| 77 | + { |
| 78 | + text: '快速开始', |
| 79 | + items: [ |
| 80 | + { text: 'Lesson 1: Hello World', link: '/zh/guide/lesson-1-helloworld' } |
| 81 | + ] |
| 82 | + }, |
| 83 | + { |
| 84 | + text: 'Hook 机制', |
| 85 | + items: [ |
| 86 | + { text: 'Lesson 2: Kprobe', link: '/zh/guide/lesson-2-kprobe' }, |
| 87 | + { text: 'Lesson 3: Uprobe', link: '/zh/guide/lesson-3-uprobe' }, |
| 88 | + { text: 'Lesson 8: Tracepoint', link: '/zh/guide/lesson-8-tracepoint' }, |
| 89 | + { text: 'Lesson 9: Raw Tracepoint', link: '/zh/guide/lesson-9-raw-tracepoint' } |
| 90 | + ] |
| 91 | + }, |
| 92 | + { |
| 93 | + text: '数据结构', |
| 94 | + items: [ |
| 95 | + { text: 'Lesson 4: 用户态 Map', link: '/zh/guide/lesson-4-user-map' }, |
| 96 | + { text: 'Lesson 5: 内核态 Map', link: '/zh/guide/lesson-5-kernel-user-map' }, |
| 97 | + { text: 'Lesson 7: Ring/Perf Buffer', link: '/zh/guide/lesson-7-ringbuffer-perfbuffer' } |
| 98 | + ] |
| 99 | + }, |
| 100 | + { |
| 101 | + text: '网络编程', |
| 102 | + items: [ |
| 103 | + { text: 'Lesson 11: TC Ingress', link: '/zh/guide/lesson-11-tc-ingress' }, |
| 104 | + { text: 'Lesson 12: TC Egress', link: '/zh/guide/lesson-12-tc-egress' }, |
| 105 | + { text: 'Lesson 17: XDP 过滤', link: '/zh/guide/lesson-17-xdp-filter' } |
| 106 | + ] |
| 107 | + }, |
| 108 | + { |
| 109 | + text: '高级主题', |
| 110 | + items: [ |
| 111 | + { text: 'Lesson 6: Go 语言开发', link: '/zh/guide/lesson-6-golang-develop' }, |
| 112 | + { text: 'Lesson 10: BTF', link: '/zh/guide/lesson-10-btf' }, |
| 113 | + { text: 'Lesson 13: SSL Sniff', link: '/zh/guide/lesson-13-ssl-sniff' } |
| 114 | + ] |
| 115 | + }, |
| 116 | + { |
| 117 | + text: '实战项目', |
| 118 | + items: [ |
| 119 | + { text: 'Lesson 14: HTTPS 流量监控', link: '/zh/guide/lesson-14-ssl-traffic-monitor' }, |
| 120 | + { text: 'Lesson 15: 进程命令监控', link: '/zh/guide/lesson-15-exec-command-monitor' }, |
| 121 | + { text: 'Lesson 16: Bash 命令监控', link: '/zh/guide/lesson-16-bash-readline-monitor' } |
| 122 | + ] |
| 123 | + } |
| 124 | + ] |
| 125 | + }, |
| 126 | + outlineTitle: '本页目录', |
| 127 | + lastUpdatedText: '最后更新', |
| 128 | + docFooter: { |
| 129 | + prev: '上一篇', |
| 130 | + next: '下一篇' |
| 131 | + } |
| 132 | + } |
| 133 | + } |
| 134 | + }, |
| 135 | + |
| 136 | + themeConfig: { |
| 137 | + // 搜索 |
| 138 | + search: { |
| 139 | + provider: 'local', |
| 140 | + options: { |
| 141 | + locales: { |
| 142 | + zh: { |
| 143 | + translations: { |
| 144 | + button: { |
| 145 | + buttonText: '搜索文档', |
| 146 | + buttonAriaLabel: '搜索文档' |
| 147 | + }, |
| 148 | + modal: { |
| 149 | + noResultsText: '无法找到相关结果', |
| 150 | + resetButtonTitle: '清除查询条件', |
| 151 | + footer: { |
| 152 | + selectText: '选择', |
| 153 | + navigateText: '切换' |
| 154 | + } |
| 155 | + } |
| 156 | + } |
| 157 | + } |
| 158 | + } |
| 159 | + } |
| 160 | + }, |
| 161 | + |
| 162 | + // 社交链接 |
| 163 | + socialLinks: [ |
| 164 | + { icon: 'github', link: 'https://github.com/haolipeng/ebpf-tutorial' } |
| 165 | + ], |
| 166 | + |
| 167 | + // 页脚 |
| 168 | + footer: { |
| 169 | + message: 'Released under the MIT License.', |
| 170 | + copyright: 'Copyright © 2024-present haolipeng' |
| 171 | + }, |
| 172 | + |
| 173 | + // 编辑链接 |
| 174 | + editLink: { |
| 175 | + pattern: 'https://github.com/haolipeng/ebpf-tutorial/edit/master/docs/:path', |
| 176 | + text: 'Edit this page on GitHub' |
| 177 | + } |
| 178 | + } |
| 179 | +}) |
0 commit comments