website generator, standard library, and home of paperclover.net https://paperclover.net
  • TypeScript 85.3%
  • Marko 8.5%
  • CSS 5.2%
  • JavaScript 0.5%
  • HTML 0.2%
  • Other 0.2%
Find a file
clover caruso ac3b5bd9b0
feat: few fixes to meta
this lets me use it at work with no patches.
2026-07-10 15:55:31 -07:00
framework chore: rename lib module error to exception 2026-06-15 13:02:24 -07:00
lib feat: few fixes to meta 2026-07-10 15:55:31 -07:00
src chore: rename lib module error to exception 2026-06-15 13:02:24 -07:00
.dockerignore setup source of truth server 2025-10-14 02:40:46 -07:00
.gitignore chore: switch tests to vitest 2026-03-21 18:03:28 -07:00
dprint.jsonc feat: marko formatting 2026-04-06 01:17:01 -07:00
flake.lock chore: update to node 26 2026-05-28 02:30:18 -07:00
flake.nix chore: update to node 26 2026-05-28 02:30:18 -07:00
package-lock.json chore: publish lib v5 2026-06-15 12:49:48 -07:00
package.json feat: random stuff on site and bug fixes too 2026-06-01 12:56:36 -07:00
readme.md chore: ai psychosis 2026-05-28 02:30:18 -07:00
run.js feat: watcher-based file indexing 2026-06-12 18:10:53 -07:00
tsconfig.json feat: http.serve 2026-03-27 22:30:26 -07:00

clover sitegen framework and typescript library

this repository contains clover's "sitegen" framework, which is a set of tools that assist building websites. additionally, this is the home of her typescript library lib, containing many high quality standalone sub-projects. all these tools power https://paperclover.net.

none of these tools are complex or revolutionary. rather, this project is the sum of many years of experience on managing content heavy websites, and an example on how other over-complicate other frameworks.

Included is src, which contains paperclover.net's source code. Highlights:

Development

minimum system requirements:

  • a cpu with at least 1 core.
  • random access memory.
  • windows 7 or later, macos, or other operating system.

required software:

  • node.js v24

my development machine, for example, is Dell Inspiron 7348 with Core i7

# install, build, serve, and watch for incremental rebuilds
node run watch

# create a production site
node run generate
node --enable-source-maps .clover/o/backend

for unix systems, the provided flake.nix can be used with nix develop to open a shell with all needed system dependencies.

Deployment

there are two primary server components to be deployed: the web server and the sourth of truth server. The latter is a singleton that runs on Clover's NAS, which holds the full contents of the file storage. The web server pulls data from the source of truth and renders web pages, and can be duplicated to multiple cloud hosts without issue.

Deployment of the source of truth can be done with Docker Compose:

services:
  backend:
    container_name: backend
    build:
      # this uses loopback to hit the self-hosted git server,
      # docker will cache the image to not re-fetch on reboot.
      context: http://127.0.0.1:3000/clo/sitegen.git
      dockerfile: src/source-of-truth.dockerfile
    environment:
      # configuration
      - PORT=43200
      - CLOVER_DB=/data
      - CLOVER_FILE_RAW=/published
      - CLOVER_FILE_DERIVED=/data/derived
      - CLOVER_SOT_KEY=... # guards private/unreleased content
    ports:
      - '43200:43200'
    restart: unless-stopped
    volumes:
      - /mnt/storage1/clover/Documents/Config/paperclover:/data
      - /mnt/storage1/clover/Published:/published

Due to caching, images may need to be purged via docker image rm {image} -f when an update is desired. Some docker GUIs support force pulls, some are buggy.

The web server performs rendering. A Dockerfile for it is present in src/web.dockerfile but it is currently unused. Deployments are done by building the project locally, and then using rsync to copy files.

node run generate
rsync .clover/o "$REMOTE_USER:~/paperclover" --exclude=.clover --exclude=.env \
  --delete-after --progress --human-readable
ssh "$REMOTE_USER" /bin/bash << EOF
    set -e
    cd ~/paperclover
    npm ci
    pm2 restart site
    echo "-> https://paperclover.net"
EOF

Contributions

No contributions to src accepted, only lib and framework.