64 lines
1.6 KiB
Markdown
64 lines
1.6 KiB
Markdown
|
# gendex
|
||
|
gendex is a script which generates directory listings and outputs them into an `index.html` file.
|
||
|
|
||
|
|
||
|
# Usage
|
||
|
`env <some environment variables here> ./gendex.sh`
|
||
|
|
||
|
## Environment variables
|
||
|
gendex supports environment variables for build and output customization.
|
||
|
All environment variables are prefixed with `GENDEX_`.
|
||
|
To avoid unnecessary table bloat, we've decided to leave it out.
|
||
|
|
||
|
For a list of data types, see [this sos!bashutils documentation page](https://bashutils.staropensource.de/introduction/datatypes/).
|
||
|
|
||
|
<table>
|
||
|
<tr>
|
||
|
<th>VARIABLE</th>
|
||
|
<th>TYPE</th>
|
||
|
<th>DEFAULT</th>
|
||
|
<th>DESCRIPTION</th>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<th>`NOFANCY`</th>
|
||
|
<th>`bool`</th>
|
||
|
<th>`false`</th>
|
||
|
<th>Whether to print things like the "Generation successful" message</th>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<th>`RECURSE`</th>
|
||
|
<th>`bool`</th>
|
||
|
<th>`false`</th>
|
||
|
<th>Whether to recurse downwards and create a directory index for all directories found</th>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<th>`MINIFY`</th>
|
||
|
<th>`bool`</th>
|
||
|
<th>`false`</th>
|
||
|
<th>Whether to minify the final output. This will just remove all newlines</th>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<th>`OUTPUT`</th>
|
||
|
<th>`str`</th>
|
||
|
<th>`./index.html`</th>
|
||
|
<th>Where gendex should output it's generated HTML file to</th>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<th>`LOCALPATH`</th>
|
||
|
<th>`str`</th>
|
||
|
<th>``</th>
|
||
|
<th>The local location of the specified directory. Used in the index's title and header. This value is always prefixed with a `/`</th>
|
||
|
</tr>
|
||
|
<tr>
|
||
|
<th>`TEMPLATE`</th>
|
||
|
<th>`str`</th>
|
||
|
<th>``</th>
|
||
|
<th>The absolute location of the .html template to use. Uses the standard template if empty</th>
|
||
|
</tr>
|
||
|
</table>
|
||
|
|
||
|
|
||
|
# Templates
|
||
|
Templates are simple HTML files which form the generator's output.
|
||
|
To specify a custom template, pass `GENDEX_TEMPLATE`
|