Package: corvette
CorvetteCorvette is a static site generator that creates a directory listing similar to an autoindex.EXAMPLE IMAGE HERE (before and after)To see Corvette in action on a live site, check outhttps://philipkiely.com/assets/.I wrote Corvette to use on my own websites. Packaging and distributing it as open source is an experiment in factoring something out of the (plate of spaghetti/big ball of mud) that is my build script. However, that means that there may be some weird behaviors or configuration steps if you're not using a similar overall setup.InstallationCorvette is written in Python and is installable with pip. It is strongly recommended that you use Corvette (and any other Python packages) in a virtual environment. To install, run:pip install corvetteAlternately, you can clone this repository and build the package locally.ConfigurationCreate and edit acorvetteconf.jsonStuff worth configuring:TODO: Fix# Display Information
ROOT_NAME = "Assets" # Root Breadcrumb Text
ROOT_LINK = "/" # Root Breadcrumb Absolute URL

# Build Information
OUTPUT_DIR = "test/sample_assets" # Where the indexes will be created
TEMPLATE_DIR = "theme/templates" # Where the template lives
# ICONS = {} # If you want to override existing icon namesSee the tests directory (link) or philipkiely.com (link) for examples.UsageIn your build script, include the line:python -m corvette corvetteconf.jsonThe conf file is technically optional but you probably need it for any real-world use.Important:Always run Corvette in your build script after your assets folder is generated for distribution to ensure complete, correct paths.Corvette assumes the underlying script is run in the project's root directory. Configure paths appropriately.Corvette runs in place, as in it should be pointed directly at yourdist/folder or equivalent.Corvette does not come with its own live reload behavior, as it is intended to be used with your existing static site generator and development environment.ThemesOut of the box, Corvette uses the default theme "Bootstrap Basic" to build pages. The source code for that theme is distributed along within the library and can be viewed in this repository at/theme/templates. It is written to be easy to read and adapt into your own theme and uses 100% of the available data passed by Jinja'srender()method.Corvette is designed to integrate with your existing (Python-based) static site generator, but can stand alone. As such, it is easier to add a single file, namedcorvette.htmlby convention, to your existing Jinja-based template than to maintain a separate theme, but the latter is possible.Adding Corvette to an Existing ThemeIf you already have a project in Pelican, MkDocs, Lektor, or any other static site generator that uses Jinja for templates, you only have to create a single file to use Corvette. Assuming you already have abase.htmlor similar, createcorvette.htmlto extend that file and use this repository's example to write your own.Creating a New Jinja Theme for CorvetteIf you want to create a new Jinja theme for Corvette (example use case: you're running just a file server) then create an appropriate template namedcorvette.html(no need for abase.htmlif the template is not designed to integrate with another template) and pointTEMPLATE_DIRto it incorvetteconf.py.If you're using Corvette with a project not written in Python, strongly consider porting the generator to your language for a simpler build process.Set Your Own IconsIf you're not using Bootstrap 5, you'll need to define your own icons (assuming you want icons in your theme). Incorvetteconf.py, create a Python dictionary with the following format:{
    "icon_classname_a": ["png", "jpg"],
    "icon_classname_a": ["pdf"]
}You can do the same if you want to override the default icon configuration.DevelopmentUse a virtual environment with requirements.txt (only dependency is Jinja and its dependencies):pip install -r requirements.txt.Helpful command:rm tests/**/index.htmlto get rid of generated indexes.ContributingIf you have code changes, please make a pull request and I will review them!DistributionFinished versions of Corvette are released on PyPi.To get ready for distribution:Increment the version number insetup.pyRunpython setup.py sdistRunpython -m twine upload dist/*TestsThe tests run off of a set of sample assets, listed below. All contents of all files are open source, public domain, or royalty-free to use.bootstrap-5.0.0-beta2-dist/css/bootstrap-grid.cssbootstrap-grid.css.map...(30 more)js/bootstrap.bundle.jsbootstrap.esm.js...(10 more)empty/Hamlet (Folger Shakespeare).pdfKayak_Lake_Unsplash.pngMountain_Cabin_Unsplash.jpgNeffex - Fight Back (Clip).mp3Neffex - Fight Back (Clip).mp4Romeo & Juliet (Folger Shakespeare).docxRomeo & Juliet (Folger Shakespeare).epubTitanic_Data.csvTitanic_Data.xlsxbootstrap-5.0.0-beta2-dist.zipsonnet_vi.mdsonnet_xxii.txtfizzbuzz.pyTo run the tests, implement tests. Some stuff to write:A folder of correct filesIf files match, test passesIf not, tests fail, print diffTest custom themeAt the moment, you just want to runpython -m corvette tests/corvetteconf.jsonand visually confirm the output.AboutCorvette is created byPhilip Kielyand open source under the MIT License. Corvette is sponsored byPK&C.