Origami comics

Extract specific files from a site

To download bulk resources from a public site, create a YAML file with the structure of what you want.

resources.yaml
index.html: true
feed.xml: true
images:
  narcissus.jpg: true
posts:
  2025-08-13.html: true
https://pondlife.netlify.app/images/narcissus.jpg

Apply that to the public site as a mask. The YAML file provides the keys at each level, the site provides the values.

download.ori
// This little Origami program gets the sites we want from a public site
Tree.mask(
  httpstree://pondlife.netlify.app, // the site to download from
  resources.yaml                    // the resources we want
)

Copy the result to local files, or include it in a larger build process.

$ ori copy download.ori, files:snapshot
$ ls -R snapshot
feed.xml        images          index.html      posts

snapshot/images:
narcissus.jpg

snapshot/posts:
2025-08-13.html
$

The files we wanted are all local now!

Tree operations like mask are like math for sites; you can use them in a variety of ways!

localhost:5000/images/narcissus.jpg

Read more: Tree.mask builtin function

  Comic index