Skip to main content

Module scan

Module scan 

Source
Expand description

Filesystem scanning and manifest generation.

Stage 1 of the Simple Gal build pipeline. Scans a directory tree to discover albums and images, producing a structured manifest that subsequent stages consume.

§Directory Structure

Simple Gal expects a specific directory layout:

content/                         # Content root
├── config.toml                  # Site configuration (optional)
├── 040-about.md                 # Page (numbered = appears in nav)
├── 050-github.md                # External link page (URL-only content)
├── 010-Landscapes/              # Album (numbered = appears in nav)
│   ├── description.txt                 # Album description (optional)
│   ├── 001-dawn.jpg             # Preview image (lowest number)
│   ├── 002-sunset.jpg
│   └── 010-mountains.jpg
├── 020-Travel/                  # Container directory (has subdirs)
│   ├── 010-Japan/               # Nested album
│   │   ├── 001-tokyo.jpg
│   │   └── 002-kyoto.jpg
│   └── 020-Italy/
│       └── 001-rome.jpg
├── 030-Minimal/                 # Another album
│   └── 001-simple.jpg
└── wip-drafts/                  # Unnumbered = hidden from nav
    └── 001-draft.jpg

§Naming Conventions

  • Numbered directories (NNN-name): Appear in navigation, sorted by number
  • Unnumbered directories: Albums exist but are hidden from navigation
  • Numbered images (NNN-name.ext): Sorted by number within album
  • Thumb images (NNN-thumb.ext or NNN-thumb-Title.ext): Designated album thumbnail
  • Image #1: Fallback album preview/thumbnail when no thumb image exists

§Output

Produces a Manifest containing:

  • Navigation tree (numbered directories only) — container directories carry an optional description field read from description.md/description.txt
  • All albums with their images
  • Pages from markdown files (content pages and external links)
  • Site configuration

§Validation

The scanner enforces these rules:

  • No mixed content (directories cannot contain both images and subdirectories)
  • No duplicate image numbers within an album
  • Every album must have at least one image

Structs§

Album
Album with its images and resolved configuration.
Image
Image metadata
Manifest
Manifest output from the scan stage

Enums§

ScanError

Functions§

scan