···6677Phanpy is hosted on [Cloudflare Pages](https://pages.cloudflare.com/) as a static website. Read more about [Cloudflare's privacy policy](https://www.cloudflare.com/privacypolicy/).
8899-## Post translations
99+## Translations
10101111-Phanpy uses [Lingva Translate](https://github.com/thedaviddelta/lingva-translate) to translate posts.
1111+Phanpy uses [Lingva API](https://github.com/cheeaun/lingva-api) and [Lingva Translate](https://github.com/thedaviddelta/lingva-translate) as fallbacks for translating post content, profile bio and media description.
12121313## Error logging
1414
+61-3
README.md
···126126127127Two ways (choose one):
128128129129-1. (Recommended) Go to [Releases](https://github.com/cheeaun/phanpy/releases) and download the latest `phanpy-dist.zip`. It's pre-built so don't need to run any install/build commands. Extract it. Serve the folder of extracted files.
130130-2. Download or `git clone` this repository. Build it by running `npm run build` (after `npm install`). Serve the `dist` folder.
129129+### Easy way
131130132132-Try search for "how to self-host static sites" as there are many ways to do it.
131131+Go to [Releases](https://github.com/cheeaun/phanpy/releases) and download the latest `phanpy-dist.zip` or `phanpy-dist.tar.gz`. It's pre-built so don't need to run any install/build commands. Extract it. Serve the folder of extracted files.
132132+133133+### Custom-build way
134134+135135+Requires [Node.js](https://nodejs.org/).
136136+137137+Download or `git clone` this repository. Use `production` branch for *stable* releases, `main` for *latest*. Build it by running `npm run build` (after `npm install`). Serve the `dist` folder.
138138+139139+Customization can be done by passing environment variables to the build command. Examples:
140140+141141+```bash
142142+PHANPY_APP_TITLE="Phanpy Dev" \
143143+ PHANPY_WEBSITE="https://dev.phanpy.social" \
144144+ npm run build
145145+```
146146+147147+```bash
148148+PHANPY_DEFAULT_INSTANCE=hachyderm.io \
149149+ PHANPY_DEFAULT_INSTANCE_REGISTRATION_URL=https://hachyderm.io/auth/sign_up \
150150+ PHANPY_PRIVACY_POLICY_URL=https://hachyderm.io/privacy-policy \
151151+ npm run build
152152+```
153153+154154+It's also possible to set them in the `.env` file.
155155+156156+Available variables:
157157+158158+- `PHANPY_CLIENT_NAME` (optional, default: `Phanpy`) affects:
159159+ - Web page title, shown in the browser window or tab title
160160+ - App title, when installed as PWA, shown in the Home screen, macOS dock, Windows taskbar, etc
161161+ - OpenGraph card title, when shared on social networks
162162+ - Client name, when [registering the app for authentication](https://docs.joinmastodon.org/client/token/#app) and shown as client used on posts in some apps/clients
163163+- `PHANPY_WEBSITE` (optional but recommended, default: `https://phanpy.social`) affects:
164164+ - Canonical URL of the website
165165+ - OpenGraph card URL, when shared on social networks
166166+ - Root path for the OpenGraph card image
167167+ - Client URL, when [registering the app for authentication](https://docs.joinmastodon.org/client/token/#app) and shown as client used on posts in some apps/clients
168168+- `PHANPY_DEFAULT_INSTANCE` (optional, no defaults):
169169+ - e.g. 'mastodon.social', without `https://`
170170+ - Default instance for log-in
171171+ - When logging in, the user will be redirected instantly to the instance's authentication page instead of having to manually type the instance URL and submit
172172+- `PHANPY_DEFAULT_INSTANCE_REGISTRATION_URL` (optional, no defaults):
173173+ - URL of the instance registration page
174174+ - E.g. `https://mastodon.social/auth/sign_up`
175175+- `PHANPY_PRIVACY_POLICY_URL` (optional, default to official instance's privacy policy):
176176+ - URL of the privacy policy page
177177+ - May specify the instance's own privacy policy
178178+- `PHANPY_LINGVA_INSTANCES` (optional, space-separated list, default: `lingva.phanpy.social [...hard-coded list of fallback instances]`):
179179+ - Specify a space-separated list of instances. First will be used as default before falling back to the subsequent instances. If there's only 1 instance, means no fallback.
180180+ - May specify a self-hosted Lingva instance, powered by either [lingva-translate](https://github.com/thedaviddelta/lingva-translate) or [lingva-api](https://github.com/cheeaun/lingva-api)
181181+ - List of fallback instances hard-coded in `/.env`
182182+ - [↗️ List of lingva-translate instances](https://github.com/thedaviddelta/lingva-translate?tab=readme-ov-file#instances)
183183+184184+### Static site hosting
185185+186186+Try online search for "how to self-host static sites" as there are many ways to do it.
187187+188188+#### Lingva-translate or lingva-api hosting
189189+190190+See documentation for [lingva-translate](https://github.com/thedaviddelta/lingva-translate) or [lingva-api](https://github.com/cheeaun/lingva-api).
133191134192## Community deployments
135193