mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-01 00:42:49 +08:00
web: add a Ko-fi donation button
A small pill in the bottom right corner, in Ko-fi's own red rather than the theme colors so it reads as what it is. It sits above the feedback button where that one exists and takes its place where it does not; the offset follows the instance rather than the dialog, so opening feedback does not make it jump. Unlike the feedback button this is not limited to the maintainer's own instance - it ships in every build, the Docker image included. Since that means self-hosters carry someone else's donation link, there is a way out: VITE_DONATE_URL= (empty) drops the button, any other value retargets it, and the Dockerfile passes it through as --build-arg DONATE_URL. The "keep" sentinel there is not decoration - an unset and an empty build arg are indistinguishable inside RUN, so without it "not passed" would silently mean "remove". Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
This commit is contained in:
1 parent
fa4daf7831
commit
6ebc3e22e0
5 files changed
+90
-1
No files matched your search
+8
-1
@@ -23,9 +23,16 @@ RUN npm ci
|
||||
RUN node -e "require('@rolldown/binding-linux-x64-gnu')" \
|
||||
|| (rm -rf node_modules package-lock.json && npm install)
|
||||
COPY web/ ./
|
||||
# The UI carries a small Ko-fi donation button (see web/src/App.tsx).
|
||||
# `--build-arg DONATE_URL=` (empty) drops it, any other value points it
|
||||
# elsewhere; left alone, the project default is used. The "keep" sentinel
|
||||
# exists because an unset build arg and an empty one are indistinguishable
|
||||
# inside RUN - without it, "not passed" would silently mean "remove".
|
||||
ARG DONATE_URL=keep
|
||||
# tsc -b currently fails on pre-existing type errors unrelated to this build;
|
||||
# vite build alone is enough to produce the production bundle.
|
||||
RUN npx vite build
|
||||
RUN if [ "$DONATE_URL" = "keep" ]; then npx vite build; \
|
||||
else VITE_DONATE_URL="$DONATE_URL" npx vite build; fi
|
||||
|
||||
# --- Gateway ----------------------------------------------------------------
|
||||
FROM node:22-bookworm-slim AS gateway-builder
|
||||
|
||||
Reference in new issue
Block a user