Commit 759ffac
fix: Unable to navigate on server without default index support (#1372)
* Fix: Cannot serve off `/.../index.html`
Docsify must be hosted on a server that supports a default directory
index (i.e. maps `/.../` -> `/.../index.html`).
Some platforms do not support this, however. For example, HTML apps
hosted on the popular game/software platform, Itch.io.
This change supports hosting Docsify off an explicit path file, such as
`/index.html`. It does this by:
1. Adding handling for paths like `index.html#/blah`, and
2. Normalising paths with fragments back to markdown paths
For example, `http://example.org/index.html#/blah` would be mapped to
`http://example.org/blah.md`.
This fixes:
#427
* Add end-to-end test for index file hosting
* Add code comments for explicit file changes
* Add additional tests for index file hosting
* Add additional tests for index file hosting
* [wip] Attempt to switch tests to Jest
* Add e2e test for new Jest test framework
* Verify sidebar links use file hosting
* Fix: endsWith() not supported for IE11
* Refactor: utility method moved to utility file
* Fix IE11 error from use of String.includes()
Co-authored-by: John Hildenbiddle <jhildenbiddle@users.noreply.github.com>1 parent 14ce7f3 commit 759ffac
File tree
3 files changed
+73
-4
lines changed- src/core/router
- history
- test/e2e
3 files changed
+73
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | 11 | | |
13 | 12 | | |
| |||
18 | 17 | | |
19 | 18 | | |
20 | 19 | | |
21 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
22 | 29 | | |
23 | 30 | | |
24 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
79 | 109 | | |
80 | | - | |
| 110 | + | |
81 | 111 | | |
82 | 112 | | |
83 | 113 | | |
84 | 114 | | |
85 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
0 commit comments