Skip to main content

staticdirindex

Static directory recursively create static directory indices with previews, tagged metadata and folder information blocks.

Usage with GitHub Pages and GitHub actions

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

usage: staticdirindex [--sitename SITENAME] [--baseurl BASEURL] directory

Note that the directory indices will be generated as in-place in directory

Directory header

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.

Ignores

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.

Sitemap

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.

schema.org json+ld

To Be Implemented, see #6

Previews

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

Release files for staticdirindex 1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for staticdirindex 1.9
File Size Uploaded
staticdirindex-1.9.tar.gz 8.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for staticdirindex 1.9
File Interpreter ABI Platform
staticdirindex-1.9-py3-none-any.whl Python 3 none any Details

Total release size: 16.5 kB

Release files / staticdirindex-1.9.tar.gz

Download URL staticdirindex-1.9.tar.gz
Size 8.1 kB
Tags Source
SHA-256 checksum
How to use checksums
19fed910678763269dba95ca95d65e23fe6cba36cc7e75b567a5598fb438ef6d
BLAKE2b-256 checksum
How to use checksums
0f3b802c4e6392c76946459860256623814755d6948850c1dfd72b56db4a9401
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0

Release files / staticdirindex-1.9-py3-none-any.whl

Download URL staticdirindex-1.9-py3-none-any.whl
Size 8.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15a13bc81233c79fb617af9f62b55b09cbbb6891751d237e2004b78226eb1413
BLAKE2b-256 checksum
How to use checksums
99aa0d3d6c154abfd463100e290ef20286c3a8236e5f33bf2459390a06811602
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.54.1 CPython/3.9.0

Release history Release notifications | RSS feed

1.11

2 release files

1.10

2 release files

This release

1.9 This release

2 release files

1.7

2 release files

1.6

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page