63 lines
1.8 KiB
Markdown
63 lines
1.8 KiB
Markdown
# gendex
|
|
gendex is a simple script that generates directory listings and writes 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>
|
|
<td><code>NOFANCY</code></td>
|
|
<td><code>bool</code></td>
|
|
<td><code>false</code></td>
|
|
<td>Whether to print things like the "Generation successful" message</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>RECURSE</code></td>
|
|
<td><code>bool</code></td>
|
|
<td><code>false</code></td>
|
|
<td>Whether to recurse downwards and create a directory index for all directories found</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>MINIFY</code></td>
|
|
<td><code>bool</code></td>
|
|
<td><code>true</code></td>
|
|
<td>Whether to minify the final output. This will just remove all newlines</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>OUTPUT</code></td>
|
|
<td><code>str</code></td>
|
|
<td><code>./index.html</code></td>
|
|
<td>Where gendex should output it's generated HTML file to</td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>LOCALPATH</code></td>
|
|
<td><code>str</code></td>
|
|
<td><code></code></td>
|
|
<td>The local location of the specified directory. Used in the index's title and header. This value is always prefixed with a <code>/</code></td>
|
|
</tr>
|
|
<tr>
|
|
<td><code>TEMPLATE</code></td>
|
|
<td><code>str</code></td>
|
|
<td><code></code></td>
|
|
<td>The absolute location of the .html template to use. Uses the standard template if empty</td>
|
|
</tr>
|
|
</table>
|
|
|
|
|
|
# Templates
|
|
Templates are simple HTML files which form the generator's output.
|
|
To specify a custom template, pass `GENDEX_TEMPLATE`
|