Quickstart

Five minutes from nothing to a site running on your machine.

In about five minutes you will have a site running locally.

1. Get the executable

Crisptastic is one self-contained program, installed with Gritpack:

gritpack install @frogfish/crisptastic --profile frogfish
crisptastic --version        # crisptastic 0.1.1+build-149

Builds exist for Linux on x86-64 and macOS on Apple Silicon. Production hosting needs Linux; a Mac is for writing sites.

This is a private release for now. The package lives on Frogfish's Gritpack hub, so you need a frogfish profile with a client certificate, and there is no public download yet. To get access, write to hello@frogfish.io.

2. Create a site

crisptastic init my-site
cd my-site

init writes three files:

my-site/
  crisptastic.toml      configuration, with development defaults
  index.html.crisp      a first page
  assets/site.scss      Sass, compiled to /site.css

3. Run it

crisptastic dev

Open http://127.0.0.1:6174/. Edit index.html.crisp and save: the page reloads on its own. If you introduce an error, the terminal and the browser show it, and the last working version keeps serving.

Make the page do something. Replace the body of index.html.crisp with:

<!doctype html>
<h1>Hello, {{ request.query.name }}</h1>
@if (request.query.name) {
  <p>Your name has {{= len(request.query.name) }} characters.</p>
} @else {
  <p>Try <a href="/?name=Ada">/?name=Ada</a></p>
}

Visit /?name=Ada. The page runs on the server for each request, so it can depend on the URL, form data, cookies and the session.

4. Look around without a server

crisptastic check .      # compile everything; prints "ok: 1 routes, 0 partials"
crisptastic routes .     # list every route

Use check in CI. It fails the build on any compile error.

5. Where next

If you want to...Read
Build something real step by stepTutorial
Understand the pieces firstIntroduction
Know every directive and functionPages and templating
Add pages in folders, dynamic URLs, stylesProject layout and routing
Put it on a serverDeploying a site

Things that trip up newcomers

  1. crisptastic dev ./my-site from another folder ignores my-site's crisptastic.toml. The file is read from the current directory. cd into the site, or pass --config.
  2. Assets are served at the site root. assets/logo.svg is /logo.svg, not /assets/logo.svg.
  3. A file is private only if its file name starts with _. A folder called _partials does not make its files private by itself.
  4. == is a syntax error. Use =. Inside @if (...) it can even crash check.
  5. Not everything works the same in dev as on a host. CSRF checks, Secure cookies and context.env values differ. See Sessions and forms.