feat: single-community mode (PUBLIC_SINGLE_COMMUNITY)

For instances that are one community (thebitcoin.win): "/" reroutes to the
community page, community browsing and explore lead back to it, community
names/handles are hidden on posts and in the header, and create-post
preselects the community. Unset, behaviour is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011c5BZVwWdVLrdQi9htmuth
This commit is contained in:
larsiandClaude Opus 5.5 committed 2026-11-14 01:06:07 +01:00
1 parent 6609371a28
commit a9bf3497fe
11 files changed
+105 -27

No files matched your search

+18
View File
@@ -154,3 +154,21 @@ Want your instance added here? Make a GitHub issue or make a PR. (this is for ge
I've put my best effort into developing and maintaining this open source app. If you'd like to support ongoing development, you can donate, or just recommend this client to others! [Buy me a Coffee](https://buymeacoffee.com/xylight)
<a href="https://www.buymeacoffee.com/xylight"><img src="https://img.buymeacoffee.com/button-api/?text=Buy me a coffee&emoji=&slug=xylight&button_colour=FFDD00&font_colour=000000&font_family=Poppins&outline_colour=000000&coffee_colour=ffffff" /></a>
---
## thebitcoin.win fork
This fork adds a **single-community mode** for sites where the whole instance is one community
(thebitcoin.win). Set `PUBLIC_SINGLE_COMMUNITY=<community name>` and:
- `/` shows that community's feed (address stays `/`), and `/communities`, `/explore/*` and
other `/c/<name>` pages lead back to it (`src/hooks.ts`, SvelteKit `reroute`)
- the Explore nav item, community browser entries in the command palette and the
"communities" buttons on empty feeds are hidden
- community names, handles and links are not shown on posts or in the community header
- creating a post preselects the community
Unset, the client behaves exactly like upstream Photon. All changes are guarded by
`SINGLE_COMMUNITY` from `src/lib/app/single.ts`. Licensed AGPL-3.0 like upstream; source of the
running site: https://gitea.ihler.tech/larsi/photon-tbw