# Sites

> Serve a static website from a branch and directory of a Tangled repository.

Sites serve static files from a repository at a Tangled provided domain. All users can claim a domain from [**Settings**](https://tangled.org/settings).

## Domains

If your account is on the PDS we run (`*.tngl.sh`), your sites domain is `<handle>.tngl.sh`. Otherwise, claim a `<subdomain>.tngl.io` domain under **Settings → Sites**; `sites` is reserved. You can hold one domain at a time. Releasing it disables every site on it, deletes their files, and puts the name in a 30-day cooldown before anyone else can claim it.

Custom domains are not supported at the moment.

## Configuring a site

In the repository, open **Settings → Sites** and set:

* Branch: the branch to publish from.
* Deploy directory: the directory served as the site root, e.g. `/`, `/docs`, `/public`. It must contain `index.html`.
* Site type: **Index** (served at the domain root) or **Sub-path** (served at `/<repo>/`).

A domain has at most one root site. If another repository already holds it, only the sub-path option is available.

A site is redeployed on every push to the configured branch and whenever its settings change.

## Serving rules

* A request for a directory serves its `index.html`, so `/about` serves `/about/index.html`.
* Directory URLs without a trailing slash are redirected to add one.
* Repositories other than the root site are served under `/<repo>/`.

## Disabling a site

Select **Disable** in the repository’s **Settings → Sites**. The configuration is removed, the site stops being served, and its files are deleted.