Skip to content

Commit

Permalink
docs: add hint about route path (close #1293) (#1312)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mister-Hope committed Apr 20, 2023
1 parent 5d60575 commit 1fe9635
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/guide/page.md
Expand Up @@ -31,6 +31,8 @@ Take the `docs` directory as your [sourceDir](../reference/cli.md), e.g. you are
By default, both `README.md` and `index.md` would be converted to `index.html` and generate a slash-ending route path. However, it might cause conflicts if you want to keep both of the two files.

In such case, you can set the [pagePatterns](../reference/config.md#pagepatterns) to avoid one of them being processed by VuePress, e.g. use `['**/*.md', '!**/README.md', '!.vuepress', '!node_modules']` to exclude all `README.md` files.

Also, some symbols like `:` and `+` may have special meanings for vue-router, so you should avoid using them, see [vue-router docs](https://router.vuejs.org/guide/essentials/route-matching-syntax.html) for more details.
:::

## Frontmatter
Expand Down
2 changes: 2 additions & 0 deletions docs/zh/guide/page.md
Expand Up @@ -31,6 +31,8 @@ VuePress 是以 Markdown 为中心的。你项目中的每一个 Markdown 文件
默认配置下, `README.md``index.md` 都会被转换成 `index.html` ,并且其对应的路由路径都是由斜杠结尾的。然而,如果你想同时保留这两个文件,就可能会造成冲突。

在这种情况下,你可以设置 [pagePatterns](../reference/config.md#pagepatterns) 来避免某个文件被 VuePress 处理,例如使用 `['**/*.md', '!**/README.md', '!.vuepress', '!node_modules']` 来排除所有的 `README.md` 文件。

此外,一些符号如 `:``+` 可能对 vue-router 有特殊含义,因此你应该避免使用它们,请参阅 [vue-router 文档](https://router.vuejs.org/zh/guide/essentials/route-matching-syntax.html) 了解更多详情。
:::

## Frontmatter
Expand Down

0 comments on commit 1fe9635

Please sign in to comment.