vuejs / vuepress

📝 Minimalistic Vue-powered static site generator
https://vuepress.vuejs.org
MIT License
22.45k stars 4.78k forks source link

提倡默认主目录docs为别的目录行不行呢 #3151

Closed Hanwall closed 1 year ago

Hanwall commented 1 year ago

Feature request

What problem does this feature solve?

我是外行,但是也玩了很多静态网站构建程序,您的这个很好玩但是部署的时候给我很头大的感觉,能不能在文档里面提倡程序默认主目录比如叫source。运行调试的时候vuepress dev source 就行,我自己就可以添加一个docs在项目根目录软连接到source/.vuepress/dist目录,这样部署的时候就不需要自定义action,或者写脚本提交dist目录到分支了,虽然大部分情况下主分支写代码,其它新建分支部署pages,但是个人还是喜欢直接部署主分支,因为我写的就是纯静态博客部署在gitpage的。而不是为了一个程序附加写的文档。我是看了文档新建了docs,新手当然就跟着例子写,写最后发现部署好麻烦哦。

What does the proposed API look like?

NULL

How should this be implemented in your opinion?

NULL

Are you willing to work on this yourself?

NULL

Shyam-Chen commented 1 year ago
{
  ...
  "scripts": {
    "docs:dev": "vitepress dev source",
    "docs:build": "vitepress build source",
    "docs:preview": "vitepress preview source"
  },
  ...
}
Hanwall commented 1 year ago

非常感谢。 上面的问题已经解决,只是当初看文档的时候按照文档来搞蒙了。

但是还有第二个问题就是sidebar的问题,

sidebar的深度配置有三个地方
1,markdown文件YAML front matter配置,深度最高只能为2
---
sidebar: auto
sidebarDepth: 2
---
2,themeConfig里面的sidebarDepth: 1,    // 可选的, 默认值是 1,最高到3级标题

3,Markdown: {
      extractHeaders: [ 'h2', 'h3']
  },默认情况下,VuePress 会提取 h2 和 h3 标题。你可以通过这个选项来修改提取出的标题级别。但是最高是多少级标题

我配置了3到h5级标题感觉不起作用啊,这个需要另外安装插件否

Shyam-Chen commented 1 year ago

https://vitepress.dev/reference/default-theme-sidebar#multiple-sidebars