Static directory recursively create static directory indices with previews, tagged metadata and folder information blocks.
The easiest way to deploy a site using staticdirindex is with GitHub pages and an accompanying GitHub Action, you can find an example GitHub actions workflow in example-action.yml
usage: staticdirindex [--sitename SITENAME] [--baseurl BASEURL] directory
Note that the directory indices will be generated as in-place in directory
By putting a file called header.html
in a folder it will be included at the
start of the directory listing. The contents of header.html
should not be a
full html document but rather an html fragment as it will be included inline.
By default staticdirindex will not include files or folders it uses for special
purposes in the directory listing. Note that staticdirindex will still leave
the files in place. If you want to exclude more files from the listings you can
add a .listignore
file to the root directory with the same format as a
.gitignore
.
staticdirindex will generate a sitemap.xml in the root directory and a
robots.txt file that points to this sitemap. If the --baseurl
parameter is
passed. (This is required to generate a sitemap.org
compliant file as it requires each file location to be absolute and include
protocol)
Passing --baseurl
will also add <link rel="canonical">
to each directory
listing.
To Be Implemented, see #6
This script uses preview-generator which in terms require several dependencies. staticdirindex fails gracefully by not including previews for filetypes that are not supported, or where the necessary dependencies are missing. You may have to read preview-generator's documentation to see what is required for your system, but for ubuntu-latest the following should give you previews for most things
# apt-get install zlib1g-dev libjpeg-dev python3-pythonmagick inkscape \
xvfb poppler-utils libfile-mimeinfo-perl qpdf libimage-exiftool-perl \
ufraw-batch ffmpeg libmagickwand-dev libreoffice