Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
help: Move URL redirects from Django to Astro.
Shubham Padia8f16f1139e0a
diff --git a/starlight_help/astro.config.mjs b/starlight_help/astro.config.mjsindex 78113c62a57..ee8f61eaa89 100644--- a/starlight_help/astro.config.mjs+++ b/starlight_help/astro.config.mjs@@ -555,4 +555,95 @@ export default defineConfig({],}),],+ // 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",+ },});diff --git a/zerver/lib/url_redirects.py b/zerver/lib/url_redirects.pyindex 83e84248b8c..08b96a7bebe 100644--- a/zerver/lib/url_redirects.py+++ b/zerver/lib/url_redirects.py@@ -18,119 +18,6 @@ POLICY_DOCUMENTATION_REDIRECTS: list[URLRedirect] = [URLRedirect("/terms/", "/policies/terms"),]-HELP_DOCUMENTATION_REDIRECTS: list[URLRedirect] = [- # Add URL redirects for help center documentation here:- URLRedirect("/help/pm-mention-alert-notifications", "/help/dm-mention-alert-notifications"),- URLRedirect("/help/restrict-private-messages", "/help/restrict-direct-messages"),- URLRedirect("/help/reading-pms", "/help/direct-messages"),- URLRedirect("/help/private-messages", "/help/direct-messages"),- URLRedirect("/help/configure-who-can-edit-topics", "/help/restrict-moving-messages"),- URLRedirect(- "/help/configure-message-editing-and-deletion",- "/help/restrict-message-editing-and-deletion",- ),- URLRedirect("/help/restrict-visibility-of-email-addresses", "/help/configure-email-visibility"),- URLRedirect("/help/change-default-view", "/help/configure-default-view"),- URLRedirect("/help/recent-topics", "/help/recent-conversations"),- URLRedirect(- "/help/add-custom-profile-fields",- "/help/custom-profile-fields",- ),- URLRedirect("/help/enable-enter-to-send", "/help/configure-send-message-keys"),- URLRedirect(- "/help/change-the-default-language-for-your-organization",- "/help/configure-organization-language",- ),- URLRedirect("/help/delete-a-stream", "/help/archive-a-channel"),- URLRedirect("/help/archive-a-stream", "/help/archive-a-channel"),- URLRedirect("/help/change-the-topic-of-a-message", "/help/rename-a-topic"),- URLRedirect("/help/configure-missed-message-emails", "/help/email-notifications"),- URLRedirect("/help/add-an-alert-word", "/help/dm-mention-alert-notifications#alert-words"),- URLRedirect("/help/test-mobile-notifications", "/help/mobile-notifications"),- URLRedirect(- "/help/troubleshooting-desktop-notifications",- "/help/desktop-notifications#troubleshooting-desktop-notifications",- ),- URLRedirect(- "/help/change-notification-sound", "/help/desktop-notifications#change-notification-sound"- ),- URLRedirect("/help/configure-message-notification-emails", "/help/email-notifications"),- URLRedirect("/help/disable-new-login-emails", "/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.- URLRedirect("/help/about-streams-and-topics", "/help/introduction-to-topics"),- URLRedirect("/help/streams-and-topics", "/help/introduction-to-topics"),- URLRedirect("/help/community-topic-edits", "/help/restrict-moving-messages"),- URLRedirect(- "/help/only-allow-admins-to-add-emoji", "/help/custom-emoji#change-who-can-add-custom-emoji"- ),- URLRedirect(- "/help/configure-who-can-add-custom-emoji",- "/help/custom-emoji#change-who-can-add-custom-emoji",- ),- URLRedirect("/help/add-custom-emoji", "/help/custom-emoji"),- URLRedirect("/help/night-mode", "/help/dark-theme"),- URLRedirect("/help/enable-emoticon-translations", "/help/configure-emoticon-translations"),- URLRedirect("/help/web-public-streams", "/help/public-access-option"),- URLRedirect("/help/starting-a-new-private-thread", "/help/starting-a-new-direct-message"),- URLRedirect("/help/edit-or-delete-a-message", "/help/delete-a-message"),- URLRedirect("/help/start-a-new-topic", "/help/starting-a-new-topic"),- URLRedirect("/help/configure-default-view", "/help/configure-home-view"),- URLRedirect("/help/reading-topics", "/help/reading-conversations"),- URLRedirect("/help/finding-a-topic-to-read", "/help/finding-a-conversation-to-read"),- URLRedirect("/help/view-and-browse-images", "/help/view-images-and-videos"),- URLRedirect("/help/bots-and-integrations", "/help/bots-overview"),- URLRedirect("/help/configure-notification-bot", "/help/configure-automated-notices"),- URLRedirect("/help/all-messages", "/help/combined-feed"),- URLRedirect("/help/create-streams", "/help/create-channels"),- URLRedirect("/help/create-a-stream", "/help/create-a-channel"),- URLRedirect("/help/message-a-stream-by-email", "/help/message-a-channel-by-email"),- URLRedirect("/help/browse-and-subscribe-to-streams", "/help/browse-and-subscribe-to-channels"),- URLRedirect("/help/unsubscribe-from-a-stream", "/help/unsubscribe-from-a-channel"),- URLRedirect("/help/view-stream-subscribers", "/help/view-channel-subscribers"),- URLRedirect("/help/add-or-remove-users-from-a-stream", "/help/subscribe-users-to-a-channel"),- URLRedirect("/help/pin-a-stream", "/help/pin-a-channel"),- URLRedirect("/help/change-the-color-of-a-stream", "/help/change-the-color-of-a-channel"),- URLRedirect("/help/move-content-to-another-stream", "/help/move-content-to-another-channel"),- URLRedirect("/help/manage-inactive-streams", "/help/manage-inactive-channels"),- URLRedirect("/help/stream-notifications", "/help/channel-notifications"),- URLRedirect("/help/mute-a-stream", "/help/mute-a-channel"),- URLRedirect(- "/help/manage-user-stream-subscriptions", "/help/manage-user-channel-subscriptions"- ),- URLRedirect("/help/stream-permissions", "/help/channel-permissions"),- URLRedirect("/help/stream-sending-policy", "/help/channel-posting-policy"),- URLRedirect(- "/help/configure-who-can-create-streams", "/help/configure-who-can-create-channels"- ),- URLRedirect(- "/help/configure-who-can-invite-to-streams", "/help/configure-who-can-invite-to-channels"- ),- URLRedirect(- "/help/set-default-streams-for-new-users", "/help/set-default-channels-for-new-users"- ),- URLRedirect("/help/rename-a-stream", "/help/rename-a-channel"),- URLRedirect("/help/change-the-stream-description", "/help/change-the-channel-description"),- URLRedirect("/help/change-the-privacy-of-a-stream", "/help/change-the-privacy-of-a-channel"),- URLRedirect("/help/channels-and-topics", "/help/introduction-to-topics"),- URLRedirect(- "/help/starting-a-new-topic", "/help/introduction-to-topics#how-to-start-a-new-topic"- ),- URLRedirect(- "/help/browse-and-subscribe-to-channels",- "/help/introduction-to-channels#browse-and-subscribe-to-channels",- ),- URLRedirect("/help/allow-image-link-previews", "/help/image-video-and-website-previews"),- URLRedirect("/help/getting-your-organization-started-with-zulip", "/help/moving-to-zulip"),- URLRedirect("/help/quote-and-reply", "/help/quote-or-forward-a-message"),- URLRedirect("/help/change-a-users-role", "/help/user-roles"),- URLRedirect("/help/roles-and-permissions", "/help/user-roles"),- URLRedirect("/help/add-or-remove-users-from-a-channel", "/help/subscribe-users-to-a-channel"),- URLRedirect("/help/disable-message-edit-history", "/help/restrict-message-edit-history-access"),- URLRedirect("/help/edit-a-bot", "/help/manage-a-bot"),- URLRedirect("/help/reading-dms", "/help/direct-messages"),-]-LANDING_PAGE_REDIRECTS = [# Add URL redirects for corporate landing pages here.URLRedirect("/new-user/", "/hello/"),@@ -140,6 +27,4 @@ LANDING_PAGE_REDIRECTS = [URLRedirect("/try-zulip/", "https://chat.zulip.org/?show_try_zulip_modal"),]-DOCUMENTATION_REDIRECTS = (- API_DOCUMENTATION_REDIRECTS + POLICY_DOCUMENTATION_REDIRECTS + HELP_DOCUMENTATION_REDIRECTS-)+DOCUMENTATION_REDIRECTS = API_DOCUMENTATION_REDIRECTS + POLICY_DOCUMENTATION_REDIRECTS