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: Do not use /static URLs directly.

Shubham Padiab9a76351cd50
diff --git a/starlight_help/src/components/EmoticonTranslations.astro b/starlight_help/src/components/EmoticonTranslations.astro
index e30d1e0a35e..cb164885151 100644
--- a/starlight_help/src/components/EmoticonTranslations.astro
+++ b/starlight_help/src/components/EmoticonTranslations.astro
@@ -2,24 +2,28 @@
import EmojiCodes from "../../../static/generated/emoji/emoji_codes.json";
const nameToCodePoint: Record<string, string> = EmojiCodes.name_to_codepoint;
-const rowHTML = (emoticon: string, codepoint: string, name: string) => `
+const emojiImageUrls: Record<string, {src: string}> = import.meta.glob(
+ "../../../static/generated/emoji/images-google-64/*.png",
+ {
+ eager: true,
+ import: "default",
+ },
+);
+
+const rowHTML = (emoticon: string, emoji: string, imageSrc: string) => `
<tr>
<td><code>${emoticon}</code></td>
- <td>
- <img
- src="/static/generated/emoji/images-google-64/${codepoint}.png"
- alt="${name}"
- class="emoji-big">
- </td>
+ <td><img src="${imageSrc}" alt="${emoji}" class="emoji-big"></td>
</tr>
`;
-
let body = "";
const emoticonConversions: Record<string, string> =
EmojiCodes.emoticon_conversions;
for (const name of Object.keys(emoticonConversions)) {
const emoticon: string = emoticonConversions[name]!;
- body += rowHTML(name, nameToCodePoint[emoticon.slice(1, -1)]!, emoticon);
+ const codepoint = nameToCodePoint[emoticon.slice(1, -1)]!;
+ const imagePath = `../../../static/generated/emoji/images-google-64/${codepoint}.png`;
+ body += rowHTML(name, emoticon, emojiImageUrls[imagePath]!.src);
}
---
diff --git a/starlight_help/src/content/docs/share-and-upload-files.mdx b/starlight_help/src/content/docs/share-and-upload-files.mdx
index 51bf8754827..cecbe7ddd41 100644
--- a/starlight_help/src/content/docs/share-and-upload-files.mdx
+++ b/starlight_help/src/content/docs/share-and-upload-files.mdx
@@ -4,6 +4,7 @@ title: Share and upload files
import {Steps, TabItem, Tabs} from "@astrojs/starlight/components";
+import ZulipIconCircle from "../../../../static/images/logo/zulip-icon-circle.svg";
import FlattenedSteps from "../../components/FlattenedSteps.astro";
import ZulipTip from "../../components/ZulipTip.astro";
import ModifyLinkText from "../include/_ModifyLinkText.mdx";
@@ -103,7 +104,7 @@ preview to [view the full-size image or video](/help/view-images-and-videos).
<Steps>
1. In another mobile app, select text or one or more files, and tap the
**share** button.
- 1. Tap the **Zulip** (<img src="/static/images/logo/zulip-icon-circle.svg" alt="logo" class="help-center-icon" />) logo to share to Zulip.
+ 1. Tap the **Zulip** (<img src={ZulipIconCircle.src} alt="logo" class="help-center-icon" />) logo to share to Zulip.
1. To send a channel message, select a channel and type a topic name.
To send a direct message, tap the **Direct message** tab, and choose
an existing direct message conversation or tap the **New DM** button