You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/README.md
+11-5Lines changed: 11 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -178,9 +178,9 @@ Guidelines for setting up a sidebar file:
178
178
To setup a custom sidebar:
179
179
180
180
1. Edit the *_sidebar.md* file.
181
-
2. Add items using guide above. Example:
181
+
2. Add items using guide above. Example below.
182
182
```markdown
183
-
- [Home](#docsify-template)
183
+
- [Home](/#my-app)
184
184
- [Foo](foo.md)
185
185
- [Bar](bar.md)
186
186
- Baz
@@ -191,11 +191,17 @@ To setup a custom sidebar:
191
191
192
192
#### Note on homepage link
193
193
194
-
The clickable text above the standard sidebar takes you to the cover page. You can scroll down to the homepage (_docs/README.md_), but there are no links on the page to the homepage. Therefore a link to the homepage has been included inthe example above.
194
+
The clickable text above the standard sidebar takes you to the cover page. You can scroll down to the homepage (_docs/README.md_), but there are no links on the page to the homepage. So add a link to the homepage with the first entry above. Note: An alternative is to use the nav bar config for Home button, rather than sidebar config.
195
195
196
-
More specifically, the link is a reference to an anchor tag on the root URL, where anchor tag refers the ID of the homepage heading element.
196
+
```
197
+
- [Home](/#my-app)
198
+
```
199
+
200
+
NB. The leading forwardslash is **required** here for correct behavior. As the anchor tag will be invalid on other pages such as `foo.md` which has path `/#/foo/`).
201
+
202
+
The link is a reference to an anchor tag on the root URL, where anchor tag refers the ID of the homepage heading element. This ID will be created by _Docsify_. To find it, go to the coverpage, scroll down to the homepage and click on the heading. The URL will be something like `http://localhost:3000/#/?id=my-app`. The part we want is the end e.g. `my-app`.
197
203
198
-
This ID is created already by _Docsify_. To find it, go to the coverpage, scroll down to the homepage and click on the heading. The URL will be something like `http://localhost:3000/#/?id=docsify-template`. The part we want is the end e.g. `docsify-template`. This is really the text of heading element, which has been made lowercase and hyphenated. Copy this to the sidebar file and prefix it with a hash symbol.
204
+
This is really the text of heading element, which has been made lowercase and hyphenated. Copy this to the sidebar file and prefix it with a hash symbol.
0 commit comments