···278278git push tangled main279279```280280281281+# Hosting websites on Tangled282282+283283+You can serve static websites directly from your git repositories on284284+Tangled. If you've used GitHub Pages or Codeberg Pages, this should feel285285+familiar.286286+287287+## Overview288288+289289+Every user gets a sites domain. If you signed up through Tangled's own290290+PDS (`tngl.sh`), your sites domain is automatically291291+`<your-handle>.tngl.sh` no setup needed. Otherwise, you can claim a292292+`<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 name299299+ (e.g. `alice.tngl.sh/my-project`)300300+301301+## Claiming a domain302302+303303+If you don't have a `tngl.sh` handle, you need to claim a domain before304304+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 a311311+30-day cooldown before anyone else can claim it.312312+313313+## Configuring a site for a repository314314+315315+1. Navigate to your repository316316+2. Go to **Settings → Sites** 317317+3. Choose a **branch** to deploy from318318+4. Set the **deploy directory** — the path within the repository319319+ containing your `index.html`. Use `/` for the root, or a subdirectory320320+ 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 your329329+previous deploys in the **Recent Deploys** section at the bottom of the330330+page.331331+332332+Sites are redeployed automatically on every push to the configured333333+branch.334334+335335+## Custom domains336336+337337+Tangled currently doesn't support custom domains for sites. This will be338338+added in a future update.339339+340340+## Deploy directory341341+342342+The deploy directory is the path within your repository that Tangled343343+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 -- a352352+request to `/about` will serve `/about/index.html` if it exists.353353+354354+## Site types355355+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 a363363+notice in the settings and only the sub-path option will be available.364364+365365+## Deploy triggers366366+367367+A deployment is triggered automatically when:368368+369369+- You push to the configured branch370370+- You change the site configuration (branch, deploy directory, or site371371+ type)372372+373373+## Disabling a site374374+375375+To stop serving a site, go to **Settings → Sites** in your repository376376+and click **Disable**. This removes the site configuration and stops377377+serving the site. The deployed files are also deleted from storage.378378+379379+Releasing your domain from **Settings → Sites** at the account level380380+will disable all sites associated with it and delete their files.381381+382382+281383# Knot self-hosting guide282384283385So you want to run your own knot server? Great! Here are a few prerequisites:···1338123613391237To set up a webhook for your repository:1340123813411341-1. Navigate to your repository settings13421342-2. Click the "hooks" tab13431343-3. Click "add webhook"12391239+1. Navigate to your repository12401240+2. Go to **Settings → Hooks**12411241+3. Click **new webhook**134412424. Configure your webhook:13451243 - **Payload URL**: The endpoint that will receive the webhook POST requests13461346- - **Secret**: An optional secret key for verifying webhook authenticity (auto-generated if left blank)12441244+ - **Secret**: An optional secret key for verifying webhook authenticity (leave blank to send unsigned webhooks)13471245 - **Events**: Select which events trigger the webhook (currently only push events)13481246 - **Active**: Toggle whether the webhook is enabled13491247