diff --git a/docs/configuration.md b/docs/configuration.md index 1949caf9a..4b238da76 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -44,11 +44,16 @@ window.$docsify = { '/zh-cn/changelog': '/changelog', '/changelog': 'https://raw.githubusercontent.com/docsifyjs/docsify/master/CHANGELOG', + + // You may need this if you use routerMode:'history'. '/.*/_sidebar.md': '/_sidebar.md', // See #301 }, }; ``` +> **Note** If you change [`routerMode`](#routermode) to `'history'`, you may +> want to configure an alias for your `_sidebar.md` and `_navbar.md` files. + ## auto2top - Type: `Boolean` @@ -707,6 +712,20 @@ TLDR: start with `hash` routing (the default). If you feel adventurous, learn how to configure a server, then switch to `history` mode for better experience without the `#` in the URL and SEO optimization. +> **Note** If you use `routerMode: 'history'`, you may want to add an +> [`alias`](#alias) to make your `_sidebar.md` and `_navbar.md` files always be +> loaded no matter which path is being visited. +> +> ```js +> window.$docsify = { +> routerMode: 'history', +> alias: { +> '/.*/_sidebar.md': '/_sidebar.md', +> '/.*/_navbar.md': '/_navbar.md', +> }, +> }; +> ``` + ## routes - Type: `Object`