Revela

Filter Galleries

Revela supports virtual galleries that automatically select images from a shared pool using filter expressions. Instead of manually organizing photos into folders, you define criteria and Revela builds the gallery dynamically.

Overview

๐Ÿ“ฆ Single Source

Images stored once in _images/ folder. No duplication needed.

๐Ÿ”„ Dynamic Updates

Galleries automatically update when images change or are added.

๐Ÿ” Powerful Queries

Filter by star rating, keywords, EXIF data, filename, date, and more with a simple syntax.

Basic Setup

1. Create Shared Images Folder

Create an _images/ folder (note the underscore prefix) in your source directory:

source/
โ”œโ”€โ”€ _images/           # Shared images (not a gallery itself)
โ”‚   โ”œโ”€โ”€ photo-001.jpg
โ”‚   โ”œโ”€โ”€ photo-002.jpg
โ”‚   โ””โ”€โ”€ ...
โ”œโ”€โ”€ canon/             # Filter gallery
โ”‚   โ””โ”€โ”€ _index.revela
โ”œโ”€โ”€ sony/              # Filter gallery
โ”‚   โ””โ”€โ”€ _index.revela
โ””โ”€โ”€ _index.revela      # Homepage

2. Add Filter Expression

In each gallery's _index.revela, add a filter property:

+++
title = "Canon Photos"
filter = "exif.make == 'Canon'"
+++

All photos taken with Canon cameras.

Filter Syntax

Comparison Operators

Operator Description Example
== Equal exif.make == 'Canon'
!= Not equal exif.make != 'Sony'
< Less than exif.iso < 800
<= Less than or equal exif.focalLength <= 35
> Greater than exif.iso > 1600
>= Greater than or equal exif.iso >= 3200

Logical Operators

Combine conditions with and, or, and not:

# Both conditions must be true
filter = "exif.make == 'Canon' and exif.iso >= 800"

# Either condition can be true
filter = "exif.make == 'Canon' or exif.make == 'Sony'"

# Negate a condition
filter = "not exif.make == 'Canon'"

Precedence: and binds tighter than or. Use parentheses to change order:

# Evaluated as: a or (b and c)
filter = "exif.make == 'Canon' or exif.make == 'Sony' and exif.iso >= 800"

# Evaluated as: (a or b) and c
filter = "(exif.make == 'Canon' or exif.make == 'Sony') and exif.iso >= 800"

Available Properties

Image Properties

Property Type Description
filename string Image filename (e.g., photo-001.jpg)
sourcePath string Path within the source directory
width int Image width in pixels
height int Image height in pixels
fileSize long File size in bytes
dateTaken DateTime Date the photo was taken
lastModified DateTime File last-modified timestamp

Photo Metadata

Revela reads the XMP metadata that Capture One, Lightroom, and other photo managers write into exported files:

Property Type Description
rating int? Star rating: 1โ€“5, 0 = unrated, -1 = rejected; empty when the file has none
keywords list Keywords (e.g. Selected, Startseite)
title string? Photo title; falls back to the Windows title (EXIF XPTitle)
description string? Caption; falls back to the EXIF ImageDescription

Test for a keyword with contains(keywords, 'Startseite'). It matches whole keywords and ignores upper/lower case, so Startseite-Archiv does not match.

filter = "rating >= 4"
filter = "contains(keywords, 'Startseite')"
filter = "rating >= 4 and not contains(keywords, 'Privat')"

Export your metadata. Revela can only read what is in the exported file. In Capture One, open the export recipe's Metadata tab and include the rating, keywords, and the title/description (IPTC) fields. In Lightroom Classic, set Metadata in the export dialog to All Metadata or All Except Camera & Camera Raw Info. Re-export the photos after changing the recipe.

EXIF Properties

Access via exif. prefix:

Property Type Description
exif.make string Camera manufacturer
exif.model string Camera model
exif.lensModel string Lens name
exif.fNumber double Aperture (f/2.8 = 2.8)
exif.exposureTime double Shutter speed in seconds
exif.iso int ISO sensitivity
exif.focalLength int Focal length in mm
exif.dateTaken DateTime Capture date/time from EXIF
exif.gpsLatitude double? GPS latitude (if present)
exif.gpsLongitude double? GPS longitude (if present)

Raw EXIF Access

Access any EXIF tag via exif.raw.TagName:

filter = "exif.raw.Software == 'Lightroom'"
filter = "exif.raw.Artist == 'John Doe'"

Raw EXIF values are text, so compare them with text values.


Built-in Functions

Date Functions

Function Description Example
year(date) Extract year year(dateTaken) == 2024
month(date) Extract month (1-12) month(dateTaken) == 12
day(date) Extract day (1-31) day(dateTaken) == 25

String Functions

Function Description Example
contains(str, substr) Check if contains contains(filename, 'portrait')
contains(keywords, word) Has this keyword (whole word, any case) contains(keywords, 'Startseite')
starts_with(str, prefix) Check prefix starts_with(filename, 'IMG_')
ends_with(str, suffix) Check suffix ends_with(filename, '-edit.jpg')
lower(str) To lowercase lower(exif.make) == 'canon'
upper(str) To uppercase upper(exif.make) == 'CANON'

Pipe Syntax

Chain operations using the pipe | operator:

filter_expression | sort property [asc|desc] | limit n
filter_expression | sort random | limit n

The all Keyword

Select all images without filtering:

filter = "all"
filter = "all | sort dateTaken desc"
filter = "all | sort dateTaken desc | limit 10"

Sort Clause

Sort results by any property:

# Newest first
filter = "all | sort dateTaken desc"

# By EXIF property
filter = "exif.make == 'Canon' | sort exif.iso desc"

Photos without a value for the sort field (for example no ISO) come last, in both directions; ties are broken by file name. Without a | sort clause, a filter gallery uses the page's sort or the configured image sort, exactly like a folder gallery (see Sorting).

Random Order

sort random shuffles the matching photos. Combined with limit, it picks a different selection each time:

# 15 random photos for the home page
filter = "all | sort random | limit 15"

The order is chosen while the pages are rendered, not when someone visits the site. Every revela generate pages (and so every revela generate all) draws a new selection, and the site stays the same between builds. A page filter and an inline [[gallery: โ€ฆ]] block behave the same way, and within one build the grid, the photo pages and their previous/next links all use the same order. To change it regularly, run revela generate all on a schedule (for example a nightly task); photos that are already processed are not processed again. sort random takes no asc/desc.

Limit Clause

Restrict the number of results:

# Only 5 images
filter = "all | limit 5"

# 10 newest photos
filter = "all | sort dateTaken desc | limit 10"

Literal Values

Strings

Single or double quotes both work:

filter = "filename == 'test.jpg'"
filter = "filename == \"test.jpg\""

Numbers

filter = "exif.iso == 800"       # Integer
filter = "exif.fNumber == 2.8"   # Decimal

Booleans & Null

filter = "exif.gpsLatitude != null"  # Has GPS data
filter = "exif.lensModel == null"    # No lens info

true and false are also valid literals.


Common Patterns

By Camera Brand

filter = "exif.make == 'Canon'"
filter = "exif.make == 'Sony'"
filter = "exif.make == 'Canon' or exif.make == 'Sony'"

By Year

filter = "year(dateTaken) == 2024"
filter = "year(dateTaken) >= 2020 and year(dateTaken) <= 2024"

High ISO (Low Light)

filter = "exif.iso >= 3200"
filter = "exif.iso >= 1600 | sort exif.iso desc"

Wide Angle / Telephoto

filter = "exif.focalLength <= 35"   # Wide angle
filter = "exif.focalLength >= 85"   # Portrait/Telephoto

Recent Photos (Homepage)

filter = "all | sort dateTaken desc | limit 5"

Random Selection (Homepage)

filter = "all | sort random | limit 15"

Best Rated

# All 4- and 5-star photos, best first
filter = "rating >= 4 | sort rating desc"

# 15 random photos from the best rated
filter = "rating >= 4 | sort random | limit 15"

rating comes from the XMP star rating that Capture One and Lightroom export (see Photo Metadata). Photos without a rating never match rating >= 4 and are listed last by sort rating.

By Keyword

filter = "contains(keywords, 'Startseite')"
filter = "contains(keywords, 'Startseite') | sort random | limit 15"

Filter vs Sort

Feature Filter (filter =) Sort (sort =)
Purpose Select images from _images/ Order images in any gallery
Scope Creates virtual gallery Works on existing images
Use case Dynamic collections Custom ordering

You can use both together:

+++
filter = "exif.make == 'Canon'"
sort = "dateTaken:desc"
+++

Error Handling

Invalid expressions fail the build with a position-aware message and a caret pointing at the problem:

Filter error: Expected expression, got ')'

  exif.make == ( )
              ^

Run revela generate scan to validate your filters before a full generation.

See Also