|
| 1 | +import { cwd } from 'node:process' |
| 2 | +import { defineConfig } from 'vitepress' |
| 3 | +import MarkdownItBiDirectionalLinks from '@nolebase/markdown-it-bi-directional-links' |
| 4 | + |
| 5 | +// https://vitepress.dev/reference/site-config |
| 6 | +export default defineConfig({ |
| 7 | + themeConfig: { |
| 8 | + socialLinks: [ |
| 9 | + { icon: 'github', link: 'https://github.com/nolebase/plugins' }, |
| 10 | + ], |
| 11 | + }, |
| 12 | + locales: { |
| 13 | + 'root': { |
| 14 | + label: 'English', |
| 15 | + lang: 'en', |
| 16 | + link: '/pages/en/', |
| 17 | + title: 'Nólëbase Plugins', |
| 18 | + description: 'Great plugins that made from the creators of Nólëbase', |
| 19 | + themeConfig: { |
| 20 | + nav: [ |
| 21 | + { text: 'Home', link: '/pages/en/' }, |
| 22 | + ], |
| 23 | + sidebar: [ |
| 24 | + { |
| 25 | + text: 'Markdown It Plugins', |
| 26 | + items: [ |
| 27 | + { text: 'Bi-directional Links', link: '/pages/en/plugins/markdown-it-bi-directional-links/' }, |
| 28 | + ], |
| 29 | + }, |
| 30 | + ], |
| 31 | + }, |
| 32 | + }, |
| 33 | + 'zh-CN': { |
| 34 | + label: '简体中文', |
| 35 | + lang: 'zh-CN', |
| 36 | + link: '/pages/zh-CN/', |
| 37 | + title: 'Nólëbase 插件', |
| 38 | + description: '由 Nólëbase 的创作者们制作的优秀插件', |
| 39 | + themeConfig: { |
| 40 | + nav: [ |
| 41 | + { text: '首页', link: '/pages/zh-CN/' }, |
| 42 | + ], |
| 43 | + sidebar: [ |
| 44 | + { |
| 45 | + text: 'Markdown It 插件', |
| 46 | + items: [ |
| 47 | + { text: '双向链接', link: '/pages/zh-CN/plugins/markdown-it-bi-directional-links/' }, |
| 48 | + ], |
| 49 | + }, |
| 50 | + ], |
| 51 | + }, |
| 52 | + }, |
| 53 | + }, |
| 54 | + markdown: { |
| 55 | + config(md) { |
| 56 | + md.use(MarkdownItBiDirectionalLinks({ |
| 57 | + dir: cwd(), |
| 58 | + })) |
| 59 | + // md.use(MarkdownItTokenTransform({ |
| 60 | + // transformToken: (token) => { |
| 61 | + // switch (token.type) { |
| 62 | + // case 'link_open': |
| 63 | + // token.tag = 'LinkPreviewPopup' |
| 64 | + // break |
| 65 | + // case 'link_close': |
| 66 | + // token.tag = 'LinkPreviewPopup' |
| 67 | + // } |
| 68 | + // }, |
| 69 | + // })) |
| 70 | + }, |
| 71 | + }, |
| 72 | +}) |
0 commit comments