Go to file
Hans Fast b4e2b700b5 initial commit 2026-03-02 10:45:44 +01:00
README.md initial commit 2026-03-02 10:45:44 +01:00
clientdata.ori initial commit 2026-03-02 10:45:44 +01:00
clients.yaml initial commit 2026-03-02 10:45:44 +01:00

README.md

select data from an external source with Ori and close over it

Say we have a file somewhere else with all our clients:

#clients.yaml
client1:
  name: James Jamm
  email: james@jamfactory.com
client2:
  name: Sammy Sauk
  email: sam@sockfactory.com

We want to maintain our client database in one place, and get client data for each of their websites without exposing other clients' data.

We can do this with function in an ori expression file. The function takes a clientid, and returns just that client. Origami's syntax supports passing an argument to a data file as if it were a function.

//clientdata.ori
(clientid) => /path/to/clients.yaml(clientid)

To get just James Jamm's data: ori 'clientdata.ori("client1")'