module

Gallery

Create automatic image galleries

A gallery is a folder in galleries/ that:

  • Has an index.md file
  • Has one or more images and/or sub-galleries

Then:

  • The images are assumed copied and thumbnailed
  • The index.md will be used to build a page with its contents and a nice display of the images and sub-galleries below it.

Constants

MEDIA_GLOB = "{jpg,png,webp,gif,mp4,mov,webm,mkv,m4v,avi,JPG,PNG,WEBP,GIF,MP4,MOV,WEBM,MKV,M4V,AVI}"

Files that make a folder a gallery and show up in its grid: images plus the video extensions handled by the videos feature

Class methods

content_globs

Return glob patterns for gallery content Galleries are index.md files inside galleries/

Source
create(path : Path)

Create a new gallery folder with an index.md

Source
create_file(sources : Hash(String, String), base : Path) : Markdown::File | Nil

Create a Gallery object from source files

Source
enable_from_scan(scan_result : Array(Markdown::File) | Nil, feature_set : Set(String))

Enable galleries feature using pre-scanned files

Source
ensure_index_files

For gallery folders that contain images but no index.md, generate a minimal index.md so they render as galleries too (issue #49). A folder is treated as a gallery if it directly contains images. Idempotent: existing index.md files are left untouched, and a generated file is only written once so auto-mode rebuilds settle.

Source

Nested types