nsite-clay

A web page that edits and republishes itself.

Sign in with your key and type into the page. It writes the new HTML to a Blossom server and republishes the Nostr event pointing at it, so the next reader gets a plain static file with your words already in it.

Licence
MIT-0
Install
npx nsite-clay
Hosting
Relays and Blossom
Backend
None

01 Why

Why you would want it

Most ways to put a page online end with somebody else holding the page. This one ends with you holding a key.

  • The file is the database

    Your words end up in the HTML. Open the saved file in a text editor and there they are, in markup a person could have typed.

  • A key, not an account

    The manifest carries one signature. Who may change the page is a fact about a keypair rather than a row in somebody's user table.

  • Nothing of yours to run

    Relays keep the pointer, Blossom servers keep the bytes, the browser does the rest. There is no process to restart at three in the morning.

  • Every save is kept

    Each one files a permanent snapshot naming an immutable set of hashes. Blobs deduplicate, so the whole history costs almost nothing.

02 Start

Two commands

You need Node. The first command makes a folder with the page in it and prints a key, which is the only thing that can ever change the page, so copy it somewhere before you close the terminal.

$ npx nsite-clay init mysite
$ npx nsite-clay deploy mysite --sec=nsec1…

The second one prints the address. Open it, press Sign in, and the page saves itself from then on. You come back to the terminal only for changes you would rather make in an editor.

Already have a Nostr key? Hand your npub to init and the page belongs to you from the first deploy.

$ npx nsite-clay init mysite --npub=npub1…

03 Limits

What it will not do

  • One key writes the document

    The manifest carries one signature, so there is no shared editing and no per-visitor content.

  • No conflict detection

    A replaceable event has no compare-and-swap. Two devices editing the same page will quietly lose one side's work.

  • The gateway is trusted for the first byte

    Sub-resources are hash-checked and every event is signature-checked, but the entry document cannot verify itself. Read the same page through a second gateway, or run your own.

  • No server code

    If what you are building needs a backend, this is the wrong tool.

05 Writing

From the project

Longer pieces about what this is for and how it behaves. They are Nostr long-form posts rather than files on this page, so any Nostr client shows the same text, and a new one turns up here without anybody touching the page.

Everything the project has published →

read-only

add #edit to the URL to edit this page