Make sidebar external links configurable

This commit is contained in:
thePR0M3TH3AN committed 2025-10-18 15:53:01 -04:00
1 parent f755349e13
commit 7065075c8b
5 files changed
+112 -25

No files matched your search

+36
View File
@@ -64,6 +64,42 @@ export const BLOG_URL =
*/
export const COMMUNITY_URL = null;
/**
* Optional external destination for the Nostr menu link.
*
* Point this at the profile or relay hub you want visitors to land on when
* they tap "Nostr" in the sidebar dropup. Leave empty (null or an empty
* string) to hide the link entirely.
*/
export const NOSTR_URL =
"https://primal.net/p/npub13yarr7j6vjqjjkahd63dmr27curypehx45ucue286ac7sft27y0srnpmpe";
/**
* Optional external destination for the GitHub menu link.
*
* Set this to the repository you want surfaced to operators and contributors.
* Leave empty (null or an empty string) to remove the GitHub entry from the
* sidebar dropup menu.
*/
export const GITHUB_URL = "https://github.com/PR0M3TH3AN/bitvid";
/**
* Optional external destination for the Beta menu link.
*
* Deployments that maintain a staging or beta environment can direct users to
* that surface here. Leave empty (null or an empty string) if there is no
* public beta to advertise.
*/
export const BETA_URL = "https://beta.bitvid.network/";
/**
* Optional external destination for the DNS menu link.
*
* Operators can expose their canonical DNS landing page here. Leave empty
* (null or an empty string) to hide the DNS entry from the sidebar.
*/
export const DNS_URL = "https://bitvid.network/";
/**
* Default image included in automated moderation DMs.
*
+12
View File
@@ -10,6 +10,10 @@ import {
THEME_ACCENT_OVERRIDES,
BLOG_URL,
COMMUNITY_URL,
NOSTR_URL,
GITHUB_URL,
BETA_URL,
DNS_URL,
} from "./instance-config.js";
function assertSuperAdminConfigured(value) {
@@ -115,6 +119,10 @@ function resolveConfig(overrides = {}) {
overrides.THEME_ACCENT_OVERRIDES ?? THEME_ACCENT_OVERRIDES,
blogUrl: overrides.BLOG_URL ?? BLOG_URL,
communityUrl: overrides.COMMUNITY_URL ?? COMMUNITY_URL,
nostrUrl: overrides.NOSTR_URL ?? NOSTR_URL,
githubUrl: overrides.GITHUB_URL ?? GITHUB_URL,
betaUrl: overrides.BETA_URL ?? BETA_URL,
dnsUrl: overrides.DNS_URL ?? DNS_URL,
};
}
@@ -166,4 +174,8 @@ export function validateInstanceConfig(overrides) {
assertThemeAccentOverrides(config.themeAccentOverrides);
assertOptionalHttpUrl(config.blogUrl, "BLOG_URL");
assertOptionalHttpUrl(config.communityUrl, "COMMUNITY_URL");
assertOptionalHttpUrl(config.nostrUrl, "NOSTR_URL");
assertOptionalHttpUrl(config.githubUrl, "GITHUB_URL");
assertOptionalHttpUrl(config.betaUrl, "BETA_URL");
assertOptionalHttpUrl(config.dnsUrl, "DNS_URL");
}