Skip to content

Commit 70a99c6

Browse files
docs: Update homepage
1 parent 8634fe9 commit 70a99c6

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

docs/README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ Guidelines for setting up a sidebar file:
178178
To setup a custom sidebar:
179179

180180
1. Edit the *_sidebar.md* file.
181-
2. Add items using guide above. Example:
181+
2. Add items using guide above. Example below.
182182
```markdown
183-
- [Home](#docsify-template)
183+
- [Home](/#my-app)
184184
- [Foo](foo.md)
185185
- [Bar](bar.md)
186186
- Baz
@@ -191,11 +191,17 @@ To setup a custom sidebar:
191191
192192
#### Note on homepage link
193193
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 in the 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.
195195
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`.
197203
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.
199205
200206
### 5. Configure cover page
201207

0 commit comments

Comments
 (0)