|
| 1 | + |
1 | 2 | # apindex - static file index generator/load reducer
|
2 |
| -__Generate a file index for Github Pages__ |
3 | 3 |
|
4 |
| - |
| 4 | +__Generate a file index for GitHub/GitLab Pages__ |
| 5 | + |
| 6 | + |
| 7 | + |
5 | 8 |
|
6 | 9 | ### Quick install
|
| 10 | + |
7 | 11 | ```sh
|
| 12 | + |
8 | 13 | curl https://raw.githubusercontent.com/jayanta525/apindex/master/install.sh | bash
|
| 14 | + |
9 | 15 | ```
|
10 | 16 |
|
| 17 | + |
| 18 | + |
11 | 19 | ### What is this?
|
| 20 | + |
12 | 21 | This is a program that generates `index.html` files in each directory on your server that render the file tree. This is useful for static web servers that need support for file listing. One example of this is Github Pages.
|
13 | 22 |
|
| 23 | + |
| 24 | + |
14 | 25 | It can also be used to reduce the server load for servers that serve static content, as the server does not need to generate the index each time it is accessed. Basically permanent cache.
|
15 | 26 |
|
| 27 | + |
| 28 | + |
16 | 29 | The file icons are also embedded into the `index.html` file so there is no need for aditional HTTP requests.
|
17 | 30 |
|
| 31 | +### CI/CD Pipeline |
| 32 | + |
| 33 | +The install script can be used with CI/CD with the required dependencies. |
| 34 | + |
| 35 | + |
| 36 | +Check it out here: [gitlab-ci.yml](https://gitlab.com/jayanta525/openwrt-sunxi/-/blob/master/.gitlab-ci.yml) |
| 37 | + |
| 38 | + image: ubuntu:bionic |
| 39 | + pages: |
| 40 | + script: |
| 41 | + - rm -rf .git* |
| 42 | + - apt-get update |
| 43 | + - apt-get install curl git -y |
| 44 | + - curl https://raw.githubusercontent.com/jayanta525/apindex/master/install.sh | bash |
| 45 | + - apindex . |
| 46 | + - mkdir .public |
| 47 | + - cp -r * .public |
| 48 | + - mv .public public |
| 49 | + artifacts: |
| 50 | + paths: |
| 51 | + - public |
| 52 | + only: |
| 53 | + - master |
| 54 | + |
18 | 55 | ### Demo
|
19 |
| -The FTP archive of thinkpads.org is hosted on Github Pages and its generated with apindex. |
20 |
| -Check it out: https://thinkpads.org/ftp/ |
| 56 | + |
| 57 | +This openwrt kmod download archive is hosted on GitLab Pages and its generated with apindex. |
| 58 | + |
| 59 | +Check it out: [https://jayanta525.gitlab.io/openwrt-sunxi/](https://jayanta525.gitlab.io/openwrt-sunxi/) |
| 60 | + |
| 61 | + |
21 | 62 |
|
22 | 63 | ### How do I use it?
|
| 64 | + |
23 | 65 | Just run:
|
| 66 | + |
24 | 67 | ```
|
25 | 68 | apindex <path-to-directory>
|
26 | 69 | ```
|
| 70 | + |
27 | 71 | The index header server path is based on your current working directory. So if you run the script from `/home/parent` on the directory `/home/parent/child` like this:
|
| 72 | + |
28 | 73 | ```
|
29 | 74 | cd /home/parent
|
| 75 | +
|
30 | 76 | apindex child/.
|
31 | 77 | ```
|
| 78 | + |
32 | 79 | The index is generated as __Index of /child__.
|
| 80 | + |
33 | 81 | If you want it to be absolute to the child directory, then you run apindex from there.
|
| 82 | + |
34 | 83 | ```
|
35 | 84 | cd /home/parent/child
|
| 85 | +
|
36 | 86 | apindex .
|
37 | 87 | ```
|
| 88 | + |
38 | 89 | This renders __Index of /__.
|
39 | 90 |
|
40 |
| -### How do I install it? |
41 |
| - |
42 |
| -``` |
43 |
| -tar -xf apindex-x.xx.tar.gz |
44 |
| -cp apindex-x.xx |
45 |
| -cmake . -DCMAKE_INSTALL_PREFIX=/usr |
46 |
| -sudo make install |
47 |
| -``` |
48 | 91 |
|
49 | 92 | ### How do I add/remove icons?
|
| 93 | + |
50 | 94 | See `share/icons.xml` and the files under `share/img/*`.
|
0 commit comments