···11-# fill in and rename to .env
22-# note these aren't secrets, just config
33-KNOT_DOMAIN = "knot.gracekind.net"
44-OWNER_DID = "did:plc:p572wxnsuoogcrhlfrlizlrb"
55-REPO_NAME = "tangled-pages-example"
66-BRANCH = "main"
+18-19
README.md
···33A simple way to host a website via a tangled repo.
44You can run it as a cloudflare worker or as an express server.
5566-## Setup
66+## Run
7788-Create .env pointing to the repo you want to host:
88+Create a `config.json` for your site(s).
991010+```json
1111+{
1212+ "site": {
1313+ "knotDomain": "knot.gracekind.net",
1414+ "ownerDid": "did:plc:p572wxnsuoogcrhlfrlizlrb",
1515+ "repoName": "tangled-pages-example",
1616+ "branch": "main",
1717+ "baseDir": "/public", // optional
1818+ "notFoundFilepath": "/404.html" // optional
1919+ }
2020+}
1021```
1111-KNOT_DOMAIN=knot.gracekind.net
1212-OWNER_DID=did:plc:p572wxnsuoogcrhlfrlizlrb
1313-REPO_NAME=tangled-pages-example
1414-BRANCH=main
1515-```
2222+2323+See `config.multiple.example.json` for an example of a multi-site config.
16241717-Run server:
2525+Then run:
18261927```bash
2028npm install
2121-npm start
2222-```
2323-2424-## Config
2525-2626-You can configure the site by creating a `pages_config.yaml` file in the root of the hosted repo.
2727-2828-```yaml
2929-baseDir: "/public"
3030-notFoundFilepath: "404.html"
2929+npx tangled-pages --config config.json
3130```
32313332## Limitations
34333535-It fetches files from the repo on request, so it might be slow.
3434+The server fetches files from the repo on request, so it might be slow.
3635In the future, we could cache the files and use a CI to clear the cache as needed.