]> Untitled Git - lemmy-ui.git/commitdiff
Add LEMMY_UI_CUSTOM_SCRIPT env var. Fixes #655 (#656)
authorDessalines <dessalines@users.noreply.github.com>
Wed, 25 May 2022 03:33:11 +0000 (23:33 -0400)
committerGitHub <noreply@github.com>
Wed, 25 May 2022 03:33:11 +0000 (03:33 +0000)
* Add LEMMY_UI_CUSTOM_SCRIPT env var. Fixes #655

* Change name to LEMMY_UI_CUSTOM_HTML

* Change name to LEMMY_UI_CUSTOM_HTML_HEADER

src/server/index.tsx

index 41a6ec8e1761cf4f8c4b736dc3ec73992401c2cc..a45e1b0ff1f933817e1223921b250242ac5a8f15 100644 (file)
@@ -36,6 +36,8 @@ if (process.env.NODE_ENV !== "development") {
     next();
   });
 }
+const customHtmlHeader = process.env["LEMMY_UI_CUSTOM_HTML_HEADER"] || "";
+
 server.use(express.json());
 server.use(express.urlencoded({ extended: false }));
 server.use("/static", express.static(path.resolve("./dist")));
@@ -198,6 +200,9 @@ server.get("/*", async (req, res) => {
            <!-- A remote debugging utility for mobile -->
            ${erudaStr}
 
+           <!-- Custom injected script -->
+           ${customHtmlHeader}
+
            ${helmet.title.toString()}
            ${helmet.meta.toString()}