mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-24 03:47:45 +08:00
* fix(core/gateway): option to limit directory size listing * feat(gw): HTMLDirListingLimit This is alternative take on the way we limit the HTML listing output. Instead of a hard cut-off, we list up to HTMLDirListingLimit. When a directory has more items than HTMLDirListingLimit we show additional header and footer informing user that only $HTMLDirListingLimit items are listed. This is a better UX. * fix: 0 disables Gateway.HTMLDirListingLimit * refactor: Gateway.FastDirIndexThreshold see explainer in docs/config.md * refactor: prealoc slices * docs: Gateway.FastDirIndexThreshold * refactor: core/corehttp/gateway_handler.go https://github.com/ipfs/go-ipfs/pull/8853#discussion_r851437088 * docs: apply suggestions from code review Co-authored-by: Alan Shaw <alan.shaw@protocol.ai> Co-authored-by: Marcin Rataj <lidel@lidel.org> Co-authored-by: Alan Shaw <alan.shaw@protocol.ai> |
||
|---|---|---|
| .. | ||
| src | ||
| test | ||
| dir-index.html | ||
| index.go | ||
| knownIcons.txt | ||
| package.json | ||
| README.md | ||
dir-index-html
Directory listing HTML for
go-ipfsgateways
Updating
When making updates to the directory listing page template, please note the following:
- Make your changes to the (human-friendly) source documents in the
srcdirectory and runnpm run build - Before testing or releasing, go to the top-level
./assetsdirectory and make sure to run thego generate .script to update the bindata version
Testing
- Make sure you have Go installed
- Start the test server, which lives in its own directory:
> cd test
> go run .
This will listen on localhost:3000 and reload the template every time you refresh the page.
If you get a "no such file or directory" error upon trying go run ., make sure you ran npm run build to generate the minified artifact that the test is looking for.
