Many of the sample Origami projects like the language tutorial and the minimal starter project contain npm start and run commands that invoke the ori CLI using stock “incantations”. This page explains how those incantations work.
Starting an Origami server with debugging #
The npm run start command for most Origami sample projects will issue the following command:
ori debug2 src/site.ori
The purpose of the incantation is to serve the site.ori file locally.
- The expression omits parentheses to avoid needing to quote them. The incantation could be rewritten with explicit parentheses as
ori "debug2(src/site.ori)". - The
debug2call starts a local server with debugging features enabled.
Building a site as static files #
The npm run build command for most Origami sample projects will issue this command:
ori copy src/site.ori, clear files:build
This copies the virtual tree of files in site.ori into the local build folder, creating build and cleaning out any existing contents as necessary.
- As above, this expression omits parentheses. Adding them:
ori copy(src/site.ori, clear(files:build)). - The
files:protocol finds the localbuildfolder and returns it as a tree. If this folder doesn’t exist, then the first attempt to write to the tree will create thebuildfolder. - The
clearcall deletes any existing files inbuild. - The
copycall copies the virtual tree insrc/site.orito thebuildfolder, thereby creating the static files necessary to deploy the site.