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 step | Tutorial |
| Understand the pieces first | Introduction |
| Know every directive and function | Pages and templating |
| Add pages in folders, dynamic URLs, styles | Project layout and routing |
| Put it on a server | Deploying a site |
Things that trip up newcomers
crisptastic dev ./my-sitefrom another folder ignoresmy-site'scrisptastic.toml. The file is read from the current directory.cdinto the site, or pass--config.- Assets are served at the site root.
assets/logo.svgis/logo.svg, not/assets/logo.svg. - A file is private only if its file name starts with
_. A folder called_partialsdoes not make its files private by itself. ==is a syntax error. Use=. Inside@if (...)it can even crashcheck.- Not everything works the same in
devas on a host. CSRF checks,Securecookies andcontext.envvalues differ. See Sessions and forms.