An elegant, searchable directory listing template for Jekyll and GitHub Pages.
It turns a content folder (default: public/) into an “Index of …” browsing experience with:
- file/folder listings
- breadcrumb navigation
- parent-directory navigation
- file-type icons
- in-page search and sorting
- Click Use this template.
- Create your new repository.
- Add your files under the content root (default:
public/). - Enable GitHub Pages in your new repository and choose GitHub Actions as the source.
- Push to
main.
The included workflow builds and deploys automatically.
node generate-directory-listings.jsscans your content root recursively.- It generates:
_data/directory.json(directory metadata)index.htmlfiles inside each content directory
- Jekyll renders pages using
_layouts/directory.html.
- Node.js 20+
- Jekyll toolchain for local preview (Ruby + Jekyll)
node generate-directory-listings.jsjekyll serveThen open http://localhost:4000.
Default content root is public.
You can change it in _config.yml:
content_root: publicOr override for generation with an environment variable:
CONTENT_ROOT=downloads node generate-directory-listings.jsWhen changing content_root, move your files/folders to that directory.
- Layout and styles:
_layouts/directory.html - File extension → icon mapping:
_includes/icon_mapper.html - Root redirect page:
index.html - Icons:
assets/icons/
MIT — see LICENSE.
Original repository author: Luka Mamukashvili.