Closed fajianren closed 6 months ago
`import { defineConfig } from 'vitepress'
// https://vitepress.dev/reference/site-config export default defineConfig({ title: "My Awesome Project", description: "A VitePress Site", themeConfig: { // https://vitepress.dev/reference/default-theme-config nav: [ { text: 'Home', link: '/' }, { text: 'Examples', link: '/markdown-examples' } ],
sidebar: [
{
text: 'Examples',
items: [
{ text: 'Markdown Examples', link: '/markdown-examples' },
{ text: 'Runtime API Examples', link: '/api-examples' }
]
}
],
socialLinks: [
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' }
]
} }) `
具体怎么改啊
没有明白你的意思
你的服务不是跑成功了吗
`import { defineConfig } from 'vitepress'
// https://vitepress.dev/reference/site-config export default defineConfig({ title: "Kangyue.Pro", description: "A VitePress Site", themeConfig: { // https://vitepress.dev/reference/default-theme-config nav: [ { text: '1', link: '/' }, { text: '2', link: '/markdown-examples' } ],
module.exports = {
plugins: [ require('./my-plugin.js') ] }
sidebar: [
{
text: 'Examples',
items: [
{ text: 'Markdown Examples', link: '/markdown-examples' },
{ text: 'Runtime API Examples', link: '/api-examples' }
]
}
],
socialLinks: [
{ icon: 'github', link: '/' }
]
]
} }) `
以上是config.mts文件的内容。 要把: `import AutoSidebar from 'vite-plugin-vitepress-auto-sidebar';
export default defineConfig({ vite: { plugins: [ // add plugin AutoSidebar({ // You can also set options to adjust sidebar data // see option document below }) ] }, })`
添加到哪里? (我是小白)
请教config.mts文件具体怎么写
具体怎么生成啊?有没有教程啊?
import AutoSidebar from 'vite-plugin-vitepress-auto-sidebar';
export default defineConfig({
vite: {
plugins: [
// add plugin
AutoSidebar()
]
},
})
在config
中填写这个即可自动生成,然后你按正常一样跑项目即可
谢谢回复。原有的内容要覆盖掉吗?还是? ---- 回复的原邮件 ---- @.>发送日期2024年4月10日 @.>@.>, @.>主题Re: [QC2168/vite-plugin-vitepress-auto-sidebar] 总是失败。请教config.mts文件具体怎么写,能否给个代码让我复制进去? (Issue #23) import AutoSidebar from 'vite-plugin-vitepress-auto-sidebar'; export default defineConfig({ vite: { plugins: [ // add plugin AutoSidebar() ] }, }) 在config中填写这个即可自动生成,然后你按正常一样跑项目即可 — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>
这个需要根据你的业务来进行调整,示例里只是最小demo