···278278git push tangled main
279279```
280280281281+# Hosting websites on Tangled
282282+283283+You can serve static websites directly from your git repositories on
284284+Tangled. If you've used GitHub Pages or Codeberg Pages, this should feel
285285+familiar.
286286+287287+## Overview
288288+289289+Every user gets a sites domain. If you signed up through Tangled's own
290290+PDS (`tngl.sh`), your sites domain is automatically
291291+`<your-handle>.tngl.sh` no setup needed. Otherwise, you can claim a
292292+`<subdomain>.tngl.io` domain from your settings.
293293+294294+You can serve multiple sites per domain:
295295+296296+- One **index site** served at the root of your domain (e.g.
297297+ `alice.tngl.sh`)
298298+- Any number of **sub-path sites** served under the repository name
299299+ (e.g. `alice.tngl.sh/my-project`)
300300+301301+## Claiming a domain
302302+303303+If you don't have a `tngl.sh` handle, you need to claim a domain before
304304+publishing sites:
305305+306306+1. Go to **Settings → Sites**
307307+2. Enter a subdomain (e.g. `alice` to claim `alice.tngl.io`)
308308+3. Click **claim**
309309+310310+You can only hold one domain at a time. Releasing a domain puts it in a
311311+30-day cooldown before anyone else can claim it.
312312+313313+## Configuring a site for a repository
314314+315315+1. Navigate to your repository
316316+2. Go to **Settings → Sites**
317317+3. Choose a **branch** to deploy from
318318+4. Set the **deploy directory** — the path within the repository
319319+ containing your `index.html`. Use `/` for the root, or a subdirectory
320320+ like `/docs` or `/public`
321321+5. Choose the **site type**:
322322+ - **Index site** — served at the root of your domain (e.g.
323323+ `alice.tngl.sh`)
324324+ - **Sub-path site** — served under the repository name (e.g.
325325+ `alice.tngl.sh/my-project`)
326326+6. Click **save**
327327+328328+The site will be deployed automatically. You can see the status of your
329329+previous deploys in the **Recent Deploys** section at the bottom of the
330330+page.
331331+332332+Sites are redeployed automatically on every push to the configured
333333+branch.
334334+335335+## Custom domains
336336+337337+Tangled currently doesn't support custom domains for sites. This will be
338338+added in a future update.
339339+340340+## Deploy directory
341341+342342+The deploy directory is the path within your repository that Tangled
343343+serves as the site root. It must contain an `index.html`.
344344+345345+| Deploy directory | Result |
346346+|---|---|
347347+| `/` | Serves the repository root |
348348+| `/docs` | Serves the `docs/` subdirectory |
349349+| `/public` | Serves the `public/` subdirectory |
350350+351351+Directories are served with automatic `index.html` resolution -- a
352352+request to `/about` will serve `/about/index.html` if it exists.
353353+354354+## Site types
355355+356356+| Type | URL |
357357+|---|---|
358358+| Index site | `alice.tngl.sh` |
359359+| Sub-path site | `alice.tngl.sh/my-project` |
360360+361361+Only one repository can be the index site for a given domain at a time.
362362+If another repository already holds the index site, you will see a
363363+notice in the settings and only the sub-path option will be available.
364364+365365+## Deploy triggers
366366+367367+A deployment is triggered automatically when:
368368+369369+- You push to the configured branch
370370+- You change the site configuration (branch, deploy directory, or site
371371+ type)
372372+373373+## Disabling a site
374374+375375+To stop serving a site, go to **Settings → Sites** in your repository
376376+and click **Disable**. This removes the site configuration and stops
377377+serving the site. The deployed files are also deleted from storage.
378378+379379+Releasing your domain from **Settings → Sites** at the account level
380380+will disable all sites associated with it and delete their files.
381381+382382+281383# Knot self-hosting guide
282384283385So you want to run your own knot server? Great! Here are a few prerequisites:
···1236133812371339To set up a webhook for your repository:
1238134012391239-1. Navigate to your repository settings
12401240-2. Click the "hooks" tab
12411241-3. Click "add webhook"
13411341+1. Navigate to your repository
13421342+2. Go to **Settings → Hooks**
13431343+3. Click **new webhook**
124213444. Configure your webhook:
12431345 - **Payload URL**: The endpoint that will receive the webhook POST requests
12441244- - **Secret**: An optional secret key for verifying webhook authenticity (auto-generated if left blank)
13461346+ - **Secret**: An optional secret key for verifying webhook authenticity (leave blank to send unsigned webhooks)
12451347 - **Events**: Select which events trigger the webhook (currently only push events)
12461348 - **Active**: Toggle whether the webhook is enabled
12471349