Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

help-beta: Add footer to the new help center.

Shubham Padiade472a09f9f7
diff --git a/help-beta/astro.config.mjs b/help-beta/astro.config.mjs
index 1efb588b482..e06099e4413 100644
--- a/help-beta/astro.config.mjs
+++ b/help-beta/astro.config.mjs
@@ -51,11 +51,20 @@ export default defineConfig({
optional: true,
default: true,
}),
+ SUPPORT_EMAIL: envField.string({
+ context: "client",
+ access: "public",
+ optional: true,
+ default: "[email protected]",
+ }),
},
},
integrations: [
starlight({
title: "Zulip help center",
+ components: {
+ Footer: "./src/components/Footer.astro",
+ },
pagination: false,
customCss: ["./src/styles/main.css", "./src/styles/steps.css"],
sidebar: [
diff --git a/help-beta/src/components/Footer.astro b/help-beta/src/components/Footer.astro
new file mode 100644
index 00000000000..daf823742ad
--- /dev/null
+++ b/help-beta/src/components/Footer.astro
@@ -0,0 +1,22 @@
+---
+import {CORPORATE_ENABLED, SUPPORT_EMAIL} from "astro:env/client";
+
+let footer_html = `<p>Don't see an answer to your question? <a href="mailto:{{ ${SUPPORT_EMAIL} }}">Contact this Zulip server's administrators</a> for support.</p>`;
+if (CORPORATE_ENABLED) {
+ footer_html = `<p>Your feedback helps us make Zulip better for everyone! Please <a href="/help-beta/contact-support">contact us</a> with questions, suggestions, and feature requests.</p>`;
+}
+---
+
+<footer class="sl-flex">
+ <hr />
+ <Fragment set:html={footer_html} />
+</footer>
+
+<style>
+ @layer starlight.core {
+ footer {
+ flex-direction: column;
+ gap: 1.5rem;
+ }
+ }
+</style>
diff --git a/tools/build-help-center b/tools/build-help-center
index bbd74a2384c..e61b247ca76 100755
--- a/tools/build-help-center
+++ b/tools/build-help-center
@@ -3,6 +3,7 @@
import os
import subprocess
import sys
+from email.utils import parseaddr
sys.path.insert(0, os.path.join(os.path.dirname(__file__), ".."))
@@ -21,6 +22,7 @@ from django.conf import settings
def run() -> None:
subprocess.check_call(["./tools/convert-help-center-docs-to-mdx"])
env = os.environ.copy()
+ env["SUPPORT_EMAIL"] = parseaddr(settings.ZULIP_ADMINISTRATOR)[1]
env["CORPORATE_ENABLED"] = str(settings.CORPORATE_ENABLED).lower()
subprocess.check_call(
["/usr/local/bin/corepack", "pnpm", "build"],