I want an SSG that routes to real HTML pages and doesn't load JavaScript unless it's necessary. Is that so much to ask?
npm install
npm run build
npm run dev
# Run type-checking and formatting
npm run check
# Fix lint errors
npm run lint:fix
# Run tests
npm run test
This tool allows interaction with the stack without having to manually update files and databases or generate IDs. By default the CLI will interact with the local Cloudflare development environment, but it's possible to interact with the production Cloudflare instance by adding an --omit=dev
flag.
Available resource types: article
, note
, page
# Create a new resource and start editing it
npm run cli -- new <resourceType>
# Commit the currently-edited resource to the datastore
npm run cli -- commit
# List existing resources
npm run cli -- list <resourceType>
# Read an existing resource
npm run cli -- read <resourceID>
# Edit an existing resource
npm run cli -- edit <resourceID>
# Discard the current edit
npm run cli -- discard
# Check if there are resources being edited
npm run cli -- status
# Generate a slug for the given text
npm run cli -- slugify <quotedText>
FIXME: These instructions do not include how to download existing media
- Create an
.env
file and a.dev.vars
file withAPI_TOKEN=<token>
- Log in to Cloudflare:
npx wrangler login
- Download the existing remote database to a file:
npx wrangler d1 export stack_db --remote --output=./database.sql
- Initialize the local database with the downloaded data:
npx wrangler d1 execute stack_db --local --file=database.sql
- Run
npm run dev
to run a local server, and then runnpm run build
to build the pages - Visit
http://localhost:8788/
in a browser to navigate the site
- Build command:
npm run build
- Build output directory:
build
NODE_ENV
:production
NODE_VERSION
:18
TZ
:America/New_York
API_TOKEN
:<secret>