README.md 2.74 KB
Newer Older
Juan Benet's avatar
fork  
Juan Benet committed
1
# dir-index-html
Juan Benet's avatar
Juan Benet committed
2

3 4
[![Made by Protocol Labs](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](https://protocol.ai)
[![Project: IPFS](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.io/)
Steven Allen's avatar
Steven Allen committed
5 6
[![Matrix](https://img.shields.io/badge/matrix-%23ipfs%3Amatrix.org-blue.svg?style=flat-square)](https://matrix.to/#/room/#ipfs:matrix.org)
[![IRC](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
Richard Littauer's avatar
Richard Littauer committed
7 8
[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)

9
> Directory listing HTML for `go-ipfs` gateways
Juan Benet's avatar
Juan Benet committed
10

11
**NOTE:** This repo is not intended to be used as a standalone project! This code is used by the gateway code within [`go-ipfs`](https://github.com/ipfs/go-ipfs). In the long term, once the the gateway is extracted from `go-ipfs`, the code in this repo will be merged into that gateway package.
12

Jessica Schilling's avatar
Jessica Schilling committed
13
![](https://user-images.githubusercontent.com/157609/88379209-ce6f0600-cda2-11ea-9620-20b9237bb441.png)
Juan Benet's avatar
Juan Benet committed
14

Steven Allen's avatar
Steven Allen committed
15 16
## Updating

17 18 19 20 21 22 23 24 25 26 27
When making updates to the directory listing page template, please note the following:

1. Make your changes to the (human-friendly) source documents in the `src` directory
2. Before testing or releasing, make sure to run the build script to generate a minified version in the `dist` directory:

```bash
> npm run build
```
3. To get your updates into `go-ipfs`, you'll need to do the following:
     - Cut a new, appropriately versioned release of `dir-index-html` (don't forget to bump the version number in `package.json`)
     - Make a PR against `go-ipfs` following [these instructions](https://github.com/ipfs/go-ipfs/tree/master/assets#updating-dir-index-html) for updating the directory index
Steven Allen's avatar
Steven Allen committed
28

Steven Allen's avatar
Steven Allen committed
29 30
## Testing

31 32
1. Make sure you have [Go](https://golang.org/dl/) installed
2. Start the test server, which lives in its own directory:
Steven Allen's avatar
Steven Allen committed
33 34 35 36 37

```bash
> cd test
> go run .
```
38
This will listen on [`localhost:3000`](http://localhost:3000/) and reload the template every time you refresh the page.
Steven Allen's avatar
Steven Allen committed
39

40
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.
Steven Allen's avatar
Steven Allen committed
41

Richard Littauer's avatar
Richard Littauer committed
42 43
## Contribute

44
Feel free to join in. All are welcome! A good place to start is to check the [issues](https://github.com/ipfs/dir-index-html/issues) for anything you find interesting.
Richard Littauer's avatar
Richard Littauer committed
45 46 47 48 49

This repository falls under the IPFS [Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md).

### Want to hack on IPFS?

Bryan Stenson's avatar
Bryan Stenson committed
50
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)
Richard Littauer's avatar
Richard Littauer committed
51 52 53

## License

Steven Allen's avatar
Steven Allen committed
54
MIT