Skip to content

Commit 605b56d

Browse files
authored
Documented config property for excluding paths from listing
1 parent 4fb8ddd commit 605b56d

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ You can use any of the following options:
5050
- [rewrites](#rewrites-array) (rewrite paths to different paths)
5151
- [redirects](#redirects-array) (forward paths to different paths or URLs)
5252
- [headers](#headers-array) (set custom headers)
53-
- [directoryListing](#trailingslash-boolean) (disable directory listing or restrict it to certain paths)
53+
- [directoryListing](#directorylisting-booleanarray) (disable directory listing or restrict it to certain paths)
54+
- [unlisted](#unlisted-array) (exclude paths from the directory listing)
5455
- [trailingSlash](#trailingslash-boolean) (remove or add trailing slashes to all paths)
5556

5657
### public (Boolean)
@@ -182,6 +183,23 @@ If you'd like to disable this for all paths, set this option to `false`. Further
182183
}
183184
```
184185

186+
### unlisted (Array)
187+
188+
In certain cases, you might not want a file or directory to appear in the directory listing. In these situations, there are two ways of solving this problem.
189+
190+
Either you disable the directory listing entirely (like shown [here](#directorylisting-booleanarray)), or you exclude certain paths from those listings by adding them all to this config property.
191+
192+
```json
193+
{
194+
"unlisted": [
195+
".DS_Store",
196+
".git"
197+
]
198+
}
199+
```
200+
201+
The items shown above are excluded from the directory listing by default.
202+
185203
### trailingSlash (Boolean)
186204

187205
By default, the package will try to make assumptions for when to add trailing slashes to your URLs or not. If you want to remove them, set this property to `false` and `true` if you want to force them on all URLs:

0 commit comments

Comments
 (0)