mirror of
https://github.com/zulip/zulip.git
synced 2025-10-23 04:52:12 +00:00
Fixes #35649. We do not serve the astro build via Django and thus we have to move the help center redirects. We get a warning by pagefind on all these redirects that they will be ignored in the search results as they don't have an HTML body. We can ignore this warning till the cutover and create a followup issue to solve that warning if this commit goes through main.
650 lines
29 KiB
JavaScript
650 lines
29 KiB
JavaScript
import * as fs from "node:fs";
|
|
|
|
import starlight from "@astrojs/starlight";
|
|
import {defineConfig, envField} from "astro/config";
|
|
import Icons from "unplugin-icons/vite";
|
|
|
|
// https://astro.build/config
|
|
export default defineConfig({
|
|
base: "starlight_help",
|
|
vite: {
|
|
plugins: [
|
|
// eslint-disable-next-line new-cap
|
|
Icons({
|
|
compiler: "astro",
|
|
customCollections: {
|
|
// unplugin-icons has a FileSystemIconLoader which is more
|
|
// versatile. But it only supports one directory path for
|
|
// a single set of icons. We should start using that loader
|
|
// if they add support for multiple paths in the future.
|
|
async "zulip-icon"(iconName) {
|
|
const sharedIconsPath = `../web/shared/icons/${iconName}.svg`;
|
|
const webOnlyIconsPath = `../web/images/icons/${iconName}.svg`;
|
|
|
|
if (fs.existsSync(sharedIconsPath)) {
|
|
return await fs.promises.readFile(sharedIconsPath, "utf8");
|
|
} else if (fs.existsSync(webOnlyIconsPath)) {
|
|
return await fs.promises.readFile(webOnlyIconsPath, "utf8");
|
|
}
|
|
throw new Error("Zulip icon not found.");
|
|
},
|
|
},
|
|
iconCustomizer(collection, icon, props) {
|
|
if (collection === "zulip-icon" || collection === "fa") {
|
|
// We need to override some default starlight behaviour to make
|
|
// icons look nice, see the css for this class to see the reasoning
|
|
// for each individual override of the default css.
|
|
props.class = "zulip-unplugin-icon";
|
|
|
|
if (collection === "zulip-icon" && icon.startsWith("user-circle-")) {
|
|
const iconSuffix = icon.replace("user-circle-", "");
|
|
props.class = `zulip-unplugin-icon user-circle user-circle-${iconSuffix}`;
|
|
}
|
|
}
|
|
},
|
|
}),
|
|
],
|
|
ssr: {
|
|
noExternal: ["zod"],
|
|
},
|
|
},
|
|
env: {
|
|
schema: {
|
|
SHOW_RELATIVE_LINKS: envField.boolean({
|
|
context: "client",
|
|
access: "public",
|
|
optional: true,
|
|
default: true,
|
|
}),
|
|
CORPORATE_ENABLED: envField.boolean({
|
|
context: "client",
|
|
access: "public",
|
|
optional: true,
|
|
default: true,
|
|
}),
|
|
SUPPORT_EMAIL: envField.string({
|
|
context: "client",
|
|
access: "public",
|
|
optional: true,
|
|
default: "zulip-admin@example.com",
|
|
}),
|
|
},
|
|
},
|
|
integrations: [
|
|
starlight({
|
|
title: "Zulip help center",
|
|
favicon: "../static/images/favicon.svg",
|
|
components: {
|
|
Footer: "./src/components/Footer.astro",
|
|
Head: "./src/components/Head.astro",
|
|
},
|
|
pagination: false,
|
|
routeMiddleware: "./src/route_data.ts",
|
|
customCss: ["./src/styles/main.css"],
|
|
sidebar: [
|
|
{
|
|
label: "Zulip homepage",
|
|
link: "https://zulip.com",
|
|
},
|
|
{
|
|
label: "Help center home",
|
|
slug: "index",
|
|
},
|
|
{
|
|
label: "Guides",
|
|
items: [
|
|
"getting-started-with-zulip",
|
|
{
|
|
label: "Choosing a team chat app",
|
|
link: "https://blog.zulip.com/2024/11/04/choosing-a-team-chat-app/",
|
|
},
|
|
{
|
|
label: "Why Zulip",
|
|
link: "https://zulip.com/why-zulip/",
|
|
},
|
|
"trying-out-zulip",
|
|
{
|
|
label: "Zulip Cloud or self-hosting?",
|
|
link: "/zulip-cloud-or-self-hosting",
|
|
},
|
|
"moving-to-zulip",
|
|
"moderating-open-organizations",
|
|
"setting-up-zulip-for-a-class",
|
|
"using-zulip-for-a-class",
|
|
"using-zulip-via-email",
|
|
],
|
|
},
|
|
{
|
|
label: "Getting started",
|
|
items: [
|
|
"join-a-zulip-organization",
|
|
"set-up-your-account",
|
|
"introduction-to-topics",
|
|
{
|
|
label: "Starting a new topic",
|
|
link: "/introduction-to-topics#how-to-start-a-new-topic",
|
|
},
|
|
"finding-a-conversation-to-read",
|
|
"reading-conversations",
|
|
"starting-a-new-direct-message",
|
|
"replying-to-messages",
|
|
"messaging-tips",
|
|
"keyboard-shortcuts",
|
|
],
|
|
},
|
|
{
|
|
label: "Setting up your organization",
|
|
items: [
|
|
"migrating-from-other-chat-tools",
|
|
"create-your-organization-profile",
|
|
"create-user-groups",
|
|
"customize-organization-settings",
|
|
"create-channels",
|
|
"customize-settings-for-new-users",
|
|
"invite-users-to-join",
|
|
"set-up-integrations",
|
|
],
|
|
},
|
|
{
|
|
label: "Account basics",
|
|
items: [
|
|
"edit-your-profile",
|
|
"change-your-name",
|
|
"change-your-email-address",
|
|
"change-your-profile-picture",
|
|
"change-your-password",
|
|
"configure-email-visibility",
|
|
"logging-in",
|
|
"logging-out",
|
|
"switching-between-organizations",
|
|
"import-your-settings",
|
|
"review-your-settings",
|
|
"deactivate-your-account",
|
|
],
|
|
},
|
|
{
|
|
label: "Preferences",
|
|
items: [
|
|
"dark-theme",
|
|
"font-size",
|
|
"line-spacing",
|
|
"configure-send-message-keys",
|
|
"change-your-language",
|
|
"change-your-timezone",
|
|
"change-the-time-format",
|
|
"configure-emoticon-translations",
|
|
"configure-home-view",
|
|
"enable-full-width-display",
|
|
"manage-your-uploaded-files",
|
|
],
|
|
},
|
|
{
|
|
label: "Writing messages",
|
|
items: [
|
|
"format-your-message-using-markdown",
|
|
"mention-a-user-or-group",
|
|
{
|
|
label: "Link to a channel, topic or message",
|
|
link: "/link-to-a-message-or-conversation",
|
|
},
|
|
"format-a-quote",
|
|
"quote-or-forward-a-message",
|
|
"emoji-and-emoticons",
|
|
"insert-a-link",
|
|
"saved-snippets",
|
|
"share-and-upload-files",
|
|
{
|
|
label: "Animated GIFs",
|
|
link: "/animated-gifs-from-giphy",
|
|
},
|
|
"text-emphasis",
|
|
"paragraph-and-section-formatting",
|
|
"bulleted-lists",
|
|
"numbered-lists",
|
|
"tables",
|
|
"code-blocks",
|
|
"latex",
|
|
"spoilers",
|
|
"me-action-messages",
|
|
"create-a-poll",
|
|
"collaborative-to-do-lists",
|
|
"global-times",
|
|
"start-a-call",
|
|
],
|
|
},
|
|
{
|
|
label: "Sending messages",
|
|
items: [
|
|
"open-the-compose-box",
|
|
"mastering-the-compose-box",
|
|
"resize-the-compose-box",
|
|
"typing-notifications",
|
|
{
|
|
label: "Preview messages before sending",
|
|
link: "/preview-your-message-before-sending",
|
|
},
|
|
{
|
|
label: "Verify a message was sent",
|
|
link: "/verify-your-message-was-successfully-sent",
|
|
},
|
|
"edit-a-message",
|
|
"delete-a-message",
|
|
"view-and-edit-your-message-drafts",
|
|
"schedule-a-message",
|
|
"message-a-channel-by-email",
|
|
],
|
|
},
|
|
{
|
|
label: "Reading messages",
|
|
items: [
|
|
"reading-strategies",
|
|
"inbox",
|
|
"recent-conversations",
|
|
"combined-feed",
|
|
"channel-feed",
|
|
"list-of-topics",
|
|
"left-sidebar",
|
|
"message-actions",
|
|
"marking-messages-as-read",
|
|
"marking-messages-as-unread",
|
|
"configure-unread-message-counters",
|
|
{
|
|
label: "Configure where you land",
|
|
link: "/configure-where-you-land",
|
|
},
|
|
"emoji-reactions",
|
|
"view-your-mentions",
|
|
"star-a-message",
|
|
"schedule-a-reminder",
|
|
"view-images-and-videos",
|
|
"view-messages-sent-by-a-user",
|
|
"link-to-a-message-or-conversation",
|
|
"search-for-messages",
|
|
"printing-messages",
|
|
{
|
|
label: "View message content as Markdown",
|
|
link: "/view-the-markdown-source-of-a-message",
|
|
},
|
|
{
|
|
label: "View when message was sent",
|
|
link: "/view-the-exact-time-a-message-was-sent",
|
|
},
|
|
"view-a-messages-edit-history",
|
|
"collapse-a-message",
|
|
"read-receipts",
|
|
],
|
|
},
|
|
{
|
|
label: "People",
|
|
items: [
|
|
"introduction-to-users",
|
|
"user-list",
|
|
"status-and-availability",
|
|
"user-cards",
|
|
"view-someones-profile",
|
|
"direct-messages",
|
|
"find-administrators",
|
|
],
|
|
},
|
|
{
|
|
label: "Groups",
|
|
items: ["user-groups", "view-group-members"],
|
|
},
|
|
{
|
|
label: "Channels",
|
|
items: [
|
|
"introduction-to-channels",
|
|
{
|
|
label: "Subscribe to a channel",
|
|
link: "/introduction-to-channels#browse-and-subscribe-to-channels",
|
|
},
|
|
"create-a-channel",
|
|
"pin-a-channel",
|
|
"change-the-color-of-a-channel",
|
|
"channel-folders",
|
|
"unsubscribe-from-a-channel",
|
|
"manage-inactive-channels",
|
|
"move-content-to-another-channel",
|
|
"view-channel-information",
|
|
"view-channel-subscribers",
|
|
],
|
|
},
|
|
{
|
|
label: "Topics",
|
|
items: [
|
|
"introduction-to-topics",
|
|
"rename-a-topic",
|
|
"resolve-a-topic",
|
|
"move-content-to-another-topic",
|
|
"general-chat-topic",
|
|
"delete-a-topic",
|
|
],
|
|
},
|
|
{
|
|
label: "Notifications",
|
|
items: [
|
|
"channel-notifications",
|
|
"topic-notifications",
|
|
"follow-a-topic",
|
|
"dm-mention-alert-notifications",
|
|
"mute-a-channel",
|
|
"mute-a-topic",
|
|
"mute-a-user",
|
|
"email-notifications",
|
|
"desktop-notifications",
|
|
"mobile-notifications",
|
|
{
|
|
label: "Do Not Disturb",
|
|
link: "/do-not-disturb",
|
|
},
|
|
],
|
|
},
|
|
{
|
|
label: "Apps",
|
|
items: [
|
|
{
|
|
label: "Download apps for every platform",
|
|
link: "https://zulip.com/apps/",
|
|
},
|
|
{
|
|
label: "Mobile app installation guides",
|
|
link: "/mobile-app-install-guide",
|
|
},
|
|
{
|
|
label: "Desktop installation guides",
|
|
link: "/desktop-app-install-guide",
|
|
},
|
|
"supported-browsers",
|
|
{
|
|
label: "Configure how links open",
|
|
link: "/configure-how-links-open",
|
|
},
|
|
"connect-through-a-proxy",
|
|
"custom-certificates",
|
|
],
|
|
},
|
|
{
|
|
label: "Zulip administration",
|
|
link: "#",
|
|
attrs: {
|
|
class: "non-clickable-sidebar-heading",
|
|
},
|
|
},
|
|
{
|
|
label: "Organization profile",
|
|
items: [
|
|
"organization-type",
|
|
{
|
|
label: "Communities directory",
|
|
link: "/communities-directory",
|
|
},
|
|
"linking-to-zulip",
|
|
"change-organization-url",
|
|
"deactivate-your-organization",
|
|
],
|
|
},
|
|
{
|
|
label: "Import an organization",
|
|
items: [
|
|
"import-from-mattermost",
|
|
"import-from-slack",
|
|
"import-from-rocketchat",
|
|
"export-your-organization",
|
|
],
|
|
},
|
|
{
|
|
label: "Account creation and authentication",
|
|
items: [
|
|
{
|
|
label: "Configure default new user settings",
|
|
link: "/configure-default-new-user-settings",
|
|
},
|
|
"custom-profile-fields",
|
|
"invite-new-users",
|
|
"restrict-account-creation",
|
|
"configure-authentication-methods",
|
|
"saml-authentication",
|
|
"scim",
|
|
],
|
|
},
|
|
{
|
|
label: "User management",
|
|
items: [
|
|
"manage-a-user",
|
|
"deactivate-or-reactivate-a-user",
|
|
"change-a-users-name",
|
|
"manage-user-channel-subscriptions",
|
|
"manage-user-group-membership",
|
|
],
|
|
},
|
|
{
|
|
label: "Channel management",
|
|
items: [
|
|
"create-a-channel",
|
|
{
|
|
label: "Private channels",
|
|
link: "/channel-permissions#private-channels",
|
|
},
|
|
{
|
|
label: "Public channels",
|
|
link: "/channel-permissions#public-channels",
|
|
},
|
|
"public-access-option",
|
|
"general-chat-channels",
|
|
"manage-channel-folders",
|
|
"channel-permissions",
|
|
"channel-posting-policy",
|
|
"configure-who-can-administer-a-channel",
|
|
"configure-who-can-create-channels",
|
|
{
|
|
label: "Configure who can subscribe",
|
|
link: "/configure-who-can-subscribe",
|
|
},
|
|
{
|
|
label: "Configure who can subscribe others",
|
|
link: "/configure-who-can-invite-to-channels",
|
|
},
|
|
{
|
|
label: "Configure who can unsubscribe anyone",
|
|
link: "/configure-who-can-unsubscribe-others",
|
|
},
|
|
"subscribe-users-to-a-channel",
|
|
"unsubscribe-users-from-a-channel",
|
|
"set-default-channels-for-new-users",
|
|
"rename-a-channel",
|
|
"change-the-channel-description",
|
|
"pin-information",
|
|
"change-the-privacy-of-a-channel",
|
|
{
|
|
label: "Delete or archive a channel",
|
|
link: "/archive-a-channel",
|
|
},
|
|
],
|
|
},
|
|
{
|
|
label: "Permissions management",
|
|
items: [
|
|
"manage-permissions",
|
|
"manage-user-groups",
|
|
"deactivate-a-user-group",
|
|
"user-roles",
|
|
"guest-users",
|
|
"restrict-direct-messages",
|
|
"restrict-wildcard-mentions",
|
|
{
|
|
label: "Restrict message editing",
|
|
link: "/restrict-message-editing-and-deletion",
|
|
},
|
|
"restrict-message-edit-history-access",
|
|
"restrict-moving-messages",
|
|
"restrict-resolving-topics",
|
|
"restrict-name-and-email-changes",
|
|
"restrict-profile-picture-changes",
|
|
"restrict-permissions-of-new-members",
|
|
],
|
|
},
|
|
{
|
|
label: "Organization settings",
|
|
items: [
|
|
{
|
|
label: "Configure organization language",
|
|
link: "/configure-organization-language",
|
|
},
|
|
"custom-emoji",
|
|
"configure-call-provider",
|
|
"add-a-custom-linkifier",
|
|
{
|
|
label: "Require topics in channel messages",
|
|
link: "/require-topics",
|
|
},
|
|
"image-video-and-website-previews",
|
|
"hide-message-content-in-emails",
|
|
"message-retention-policy",
|
|
"digest-emails",
|
|
"disable-welcome-emails",
|
|
"configure-a-custom-welcome-message",
|
|
"configure-automated-notices",
|
|
"configure-multi-language-search",
|
|
"analytics",
|
|
],
|
|
},
|
|
{
|
|
label: "Bots & integrations",
|
|
items: [
|
|
"bots-overview",
|
|
"integrations-overview",
|
|
"add-a-bot-or-integration",
|
|
{
|
|
label: "Generate integration URL",
|
|
link: "/generate-integration-url",
|
|
},
|
|
"manage-a-bot",
|
|
"deactivate-or-reactivate-a-bot",
|
|
"request-an-integration",
|
|
{
|
|
label: "Restrict bot creation",
|
|
link: "/restrict-bot-creation",
|
|
},
|
|
"view-your-bots",
|
|
"view-all-bots-in-your-organization",
|
|
],
|
|
},
|
|
{
|
|
label: "Support",
|
|
items: [
|
|
"view-zulip-version",
|
|
"zulip-cloud-billing",
|
|
{
|
|
label: "Self-hosted billing",
|
|
link: "/self-hosted-billing",
|
|
},
|
|
"gdpr-compliance",
|
|
{
|
|
label: "Move to Zulip Cloud",
|
|
link: "/move-to-zulip-cloud",
|
|
},
|
|
"support-zulip-project",
|
|
"linking-to-zulip-website",
|
|
"contact-support",
|
|
],
|
|
},
|
|
{
|
|
label: "◀ Back to Zulip",
|
|
link: "../",
|
|
},
|
|
],
|
|
}),
|
|
],
|
|
// Redirects in astro are just directories with index.html inside
|
|
// them doing the redirect we define in the value. The base of
|
|
// /starlight_help/ will apply to the keys in the list below but we will
|
|
// have to prepend /starlight_help/ in the redirect URL.
|
|
redirects: {
|
|
"pm-mention-alert-notifications": "/starlight_help/dm-mention-alert-notifications",
|
|
"restrict-private-messages": "/starlight_help/restrict-direct-messages",
|
|
"reading-pms": "/starlight_help/direct-messages",
|
|
"private-messages": "/starlight_help/direct-messages",
|
|
"configure-who-can-edit-topics": "/starlight_help/restrict-moving-messages",
|
|
"configure-message-editing-and-deletion":
|
|
"/starlight_help/restrict-message-editing-and-deletion",
|
|
"restrict-visibility-of-email-addresses": "/starlight_help/configure-email-visibility",
|
|
"change-default-view": "/starlight_help/configure-default-view",
|
|
"recent-topics": "/starlight_help/recent-conversations",
|
|
"add-custom-profile-fields": "/starlight_help/custom-profile-fields",
|
|
"enable-enter-to-send": "/starlight_help/configure-send-message-keys",
|
|
"change-the-default-language-for-your-organization":
|
|
"/starlight_help/configure-organization-language",
|
|
"delete-a-stream": "/starlight_help/archive-a-channel",
|
|
"archive-a-stream": "/starlight_help/archive-a-channel",
|
|
"change-the-topic-of-a-message": "/starlight_help/rename-a-topic",
|
|
"configure-missed-message-emails": "/starlight_help/email-notifications",
|
|
"add-an-alert-word": "/starlight_help/dm-mention-alert-notifications#alert-words",
|
|
"test-mobile-notifications": "/starlight_help/mobile-notifications",
|
|
"troubleshooting-desktop-notifications":
|
|
"/starlight_help/desktop-notifications#troubleshooting-desktop-notifications",
|
|
"change-notification-sound":
|
|
"/starlight_help/desktop-notifications#change-notification-sound",
|
|
"configure-message-notification-emails": "/starlight_help/email-notifications",
|
|
"disable-new-login-emails": "/starlight_help/email-notifications#new-login-emails",
|
|
// The `help/about-streams-and-topics` and `help/streams-and-topics` redirects are particularly
|
|
// important, because the old URLs appear in links from Welcome Bot messages.
|
|
"about-streams-and-topics": "/starlight_help/introduction-to-topics",
|
|
"streams-and-topics": "/starlight_help/introduction-to-topics",
|
|
"community-topic-edits": "/starlight_help/restrict-moving-messages",
|
|
"only-allow-admins-to-add-emoji":
|
|
"/starlight_help/custom-emoji#change-who-can-add-custom-emoji",
|
|
"configure-who-can-add-custom-emoji":
|
|
"/starlight_help/custom-emoji#change-who-can-add-custom-emoji",
|
|
"add-custom-emoji": "/starlight_help/custom-emoji",
|
|
"night-mode": "/starlight_help/dark-theme",
|
|
"enable-emoticon-translations": "/starlight_help/configure-emoticon-translations",
|
|
"web-public-streams": "/starlight_help/public-access-option",
|
|
"starting-a-new-private-thread": "/starlight_help/starting-a-new-direct-message",
|
|
"edit-or-delete-a-message": "/starlight_help/delete-a-message",
|
|
"start-a-new-topic": "/starlight_help/starting-a-new-topic",
|
|
"configure-default-view": "/starlight_help/configure-home-view",
|
|
"reading-topics": "/starlight_help/reading-conversations",
|
|
"finding-a-topic-to-read": "/starlight_help/finding-a-conversation-to-read",
|
|
"view-and-browse-images": "/starlight_help/view-images-and-videos",
|
|
"bots-and-integrations": "/starlight_help/bots-overview",
|
|
"configure-notification-bot": "/starlight_help/configure-automated-notices",
|
|
"all-messages": "/starlight_help/combined-feed",
|
|
"create-streams": "/starlight_help/create-channels",
|
|
"create-a-stream": "/starlight_help/create-a-channel",
|
|
"message-a-stream-by-email": "/starlight_help/message-a-channel-by-email",
|
|
"browse-and-subscribe-to-streams": "/starlight_help/browse-and-subscribe-to-channels",
|
|
"unsubscribe-from-a-stream": "/starlight_help/unsubscribe-from-a-channel",
|
|
"view-stream-subscribers": "/starlight_help/view-channel-subscribers",
|
|
"add-or-remove-users-from-a-stream": "/starlight_help/subscribe-users-to-a-channel",
|
|
"pin-a-stream": "/starlight_help/pin-a-channel",
|
|
"change-the-color-of-a-stream": "/starlight_help/change-the-color-of-a-channel",
|
|
"move-content-to-another-stream": "/starlight_help/move-content-to-another-channel",
|
|
"manage-inactive-streams": "/starlight_help/manage-inactive-channels",
|
|
"stream-notifications": "/starlight_help/channel-notifications",
|
|
"mute-a-stream": "/starlight_help/mute-a-channel",
|
|
"manage-user-stream-subscriptions": "/starlight_help/manage-user-channel-subscriptions",
|
|
"stream-permissions": "/starlight_help/channel-permissions",
|
|
"stream-sending-policy": "/starlight_help/channel-posting-policy",
|
|
"configure-who-can-create-streams": "/starlight_help/configure-who-can-create-channels",
|
|
"configure-who-can-invite-to-streams":
|
|
"/starlight_help/configure-who-can-invite-to-channels",
|
|
"set-default-streams-for-new-users": "/starlight_help/set-default-channels-for-new-users",
|
|
"rename-a-stream": "/starlight_help/rename-a-channel",
|
|
"change-the-stream-description": "/starlight_help/change-the-channel-description",
|
|
"change-the-privacy-of-a-stream": "/starlight_help/change-the-privacy-of-a-channel",
|
|
"channels-and-topics": "/starlight_help/introduction-to-topics",
|
|
"starting-a-new-topic": "/starlight_help/introduction-to-topics#how-to-start-a-new-topic",
|
|
"browse-and-subscribe-to-channels":
|
|
"/starlight_help/introduction-to-channels#browse-and-subscribe-to-channels",
|
|
"allow-image-link-previews": "/starlight_help/image-video-and-website-previews",
|
|
"getting-your-organization-started-with-zulip": "/starlight_help/moving-to-zulip",
|
|
"quote-and-reply": "/starlight_help/quote-or-forward-a-message",
|
|
"change-a-users-role": "/starlight_help/user-roles",
|
|
"roles-and-permissions": "/starlight_help/user-roles",
|
|
"add-or-remove-users-from-a-channel": "/starlight_help/subscribe-users-to-a-channel",
|
|
"disable-message-edit-history": "/starlight_help/restrict-message-edit-history-access",
|
|
"edit-a-bot": "/starlight_help/manage-a-bot",
|
|
"reading-dms": "/starlight_help/direct-messages",
|
|
},
|
|
});
|