Commit 052835b
authored
Redirect /subdir to /subdir/ when the page is given by docs/subdir/index.md (#274)
* Redirect /subdir to /subdir/ when the page is given by docs/subdir/index.md.
Otherwise links seen in preview under /subdir can look correct, but will fail in the build.
To test, run:
> yarn dev --root test/input/build/multi/
and open http://127.0.0.1:3000/subsection
* more precise redirection:
Given a /dir/index(.html) path, we redirect the browser to /dir/ if there is a dir/index.md file, otherwise to /dir.
This accomodates /javascript in the documentation as well as test/input/build/multi/subsection/
* remove redundant check1 parent d88ba1b commit 052835b
3 files changed
Lines changed: 23 additions & 6 deletions
File tree
- src
- test
- input/build/multi/subsection
- output/build/multi/subsection
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| 126 | + | |
| 127 | + | |
126 | 128 | | |
127 | | - | |
128 | | - | |
129 | | - | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
130 | 140 | | |
131 | 141 | | |
132 | 142 | | |
133 | 143 | | |
134 | 144 | | |
135 | | - | |
136 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
137 | 151 | | |
138 | 152 | | |
139 | 153 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
0 commit comments