-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ognjen Galic <[email protected]>
- Loading branch information
Showing
1 changed file
with
44 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,45 @@ | ||
This a tool to generate Apache-style directory listings | ||
for static web servers like Github Pages. | ||
# apindex - static file index generator/load reducer | ||
__Generate a file index for Github Pages__ | ||
|
||
Just copy the script to the root of the server and run | ||
mkindex.py | ||
![img](https://i.imgur.com/jyZPglj.png) | ||
|
||
### What is this? | ||
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. | ||
|
||
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. | ||
|
||
The file icons are also embedded into the `index.html` file so there is no need for aditional HTTP requests. | ||
|
||
### Demo | ||
The FTP archive of thinkpads.org is hosted on Github Pages and its generated with apindex. | ||
Check it out: https://thinkpads.org/ftp/ | ||
|
||
### How do I use it? | ||
Just run: | ||
``` | ||
apindex <path-to-directory> | ||
``` | ||
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: | ||
``` | ||
cd /home/parent | ||
apindex child/. | ||
``` | ||
The index is generated as __Index of /child__. | ||
If you want it to be absolute to the child directory, then you run apindex from there. | ||
``` | ||
cd /home/parent/child | ||
apindex . | ||
``` | ||
This renders __Index of /__. | ||
|
||
### How do I install it? | ||
|
||
``` | ||
tar -xf apindex-x.xx.tar.gz | ||
cp apindex-x.xx | ||
cmake . -DCMAKE_INSTALL_PREFIX=/usr | ||
sudo make install | ||
``` | ||
|
||
### How do I add/remove icons? | ||
See `share/icons.xml` and the files under `share/img/*`. |