From 8c568af46aa07f877097ff077aebe46240ecec46 Mon Sep 17 00:00:00 2001
From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com>
Date: Sat, 18 Oct 2025 15:28:33 -0400
Subject: [PATCH 1/3] Remove local blog view in favor of configurable external
link
---
README.md | 2 +-
blog.html | 73 --
components/sidebar.html | 8 +-
config/instance-config.js | 10 +
config/validate-config.js | 28 +
css/tailwind.generated.css | 4 +-
css/tailwind.source.css | 1255 ++++--------------------------
css/tokens.css | 101 ---
docs/design-system.md | 52 +-
js/blog/carousel.js | 232 ------
js/blog/index.js | 1123 ---------------------------
js/blog/progressBar.js | 126 ---
js/blog/zapthreadsEmbed.js | 1293 -------------------------------
js/config.js | 2 +
js/index.js | 10 +
scripts/check-design-tokens.mjs | 2 +-
tailwind.config.cjs | 55 +-
tests/blog-carousel.test.mjs | 297 -------
tests/test-helpers/blog-dom.mjs | 205 -----
views/blog.html | 129 ---
20 files changed, 210 insertions(+), 4797 deletions(-)
delete mode 100644 blog.html
delete mode 100644 js/blog/carousel.js
delete mode 100644 js/blog/index.js
delete mode 100644 js/blog/progressBar.js
delete mode 100644 js/blog/zapthreadsEmbed.js
delete mode 100644 tests/blog-carousel.test.mjs
delete mode 100644 tests/test-helpers/blog-dom.mjs
delete mode 100644 views/blog.html
diff --git a/README.md b/README.md
index 40a0855b..4ae94d20 100644
--- a/README.md
+++ b/README.md
@@ -126,7 +126,7 @@ hairline borders or browser reset quirks) add an explicit allowlist entry in
`scripts/check-design-tokens.mjs` so future contributors understand why the
constant exists.
-The script now crawls every markup-emitting module under `js/blog`, `js/ui`,
+The script now crawls every markup-emitting module under `js/ui`,
`js/channelProfile.js`, and `torrent/ui`, so UI tweaks anywhere in the repo
benefit from the guard without manual configuration.
diff --git a/blog.html b/blog.html
deleted file mode 100644
index d569d71e..00000000
--- a/blog.html
+++ /dev/null
@@ -1,73 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- bitvid Blog
-
-
-
-
-
-
-
-
-
diff --git a/components/sidebar.html b/components/sidebar.html
index d3a75c98..0f2e214b 100644
--- a/components/sidebar.html
+++ b/components/sidebar.html
@@ -168,7 +168,13 @@
/>
-
+
{
+ const element = document.querySelector(selector);
+ const sanitizedUrl = typeof url === "string" ? url.trim() : "";
+
+ if (!(element instanceof HTMLAnchorElement)) {
+ if (sanitizedUrl) {
+ userLogger.warn(
+ `${label} not found; skipping external link binding.`,
+ );
+ }
+ return;
+ }
+
+ if (!sanitizedUrl) {
+ element.remove();
+ return;
+ }
+
+ element.href = sanitizedUrl;
+ element.target = "_blank";
+ element.rel = "noopener noreferrer";
+};
+
function startApplication() {
if (application) {
return applicationReadyPromise;
@@ -210,14 +233,17 @@ async function bootstrapInterface() {
await loadSidebar("components/sidebar.html", "sidebarContainer");
devLogger.log("Sidebar loaded.");
- const blogLink = document.querySelector("[data-blog-link]");
- if (blogLink instanceof HTMLAnchorElement) {
- blogLink.href = BLOG_URL;
- blogLink.target = "_blank";
- blogLink.rel = "noopener noreferrer";
- } else {
- userLogger.warn("Sidebar blog link not found; skipping external link binding.");
- }
+ bindOptionalExternalLink({
+ selector: "[data-blog-link]",
+ url: BLOG_URL,
+ label: "Sidebar blog link",
+ });
+
+ bindOptionalExternalLink({
+ selector: "[data-community-link]",
+ url: COMMUNITY_URL,
+ label: "Sidebar community link",
+ });
const sidebar = document.getElementById("sidebar");
const collapseToggle = document.getElementById("sidebarCollapseToggle");
From 7065075c8b800ac4cdfd851246e4ef6eb3054a85 Mon Sep 17 00:00:00 2001
From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com>
Date: Sat, 18 Oct 2025 15:53:01 -0400
Subject: [PATCH 3/3] Make sidebar external links configurable
---
components/sidebar.html | 48 +++++++++++++++++++--------------------
config/instance-config.js | 36 +++++++++++++++++++++++++++++
config/validate-config.js | 12 ++++++++++
js/config.js | 8 +++++++
js/index.js | 33 ++++++++++++++++++++++++++-
5 files changed, 112 insertions(+), 25 deletions(-)
diff --git a/components/sidebar.html b/components/sidebar.html
index 71f95d3d..46966c9b 100644
--- a/components/sidebar.html
+++ b/components/sidebar.html
@@ -183,6 +183,21 @@
/>
+
-