diff --git a/client/public/locales/en/translation.json b/client/public/locales/en/translation.json index 69b1f1296..53680eedc 100644 --- a/client/public/locales/en/translation.json +++ b/client/public/locales/en/translation.json @@ -445,7 +445,7 @@ }, "avatar": { "title": "Site Avatar", - "desc": "Set the avatar shown in the navigation bar by URL, upload, or drag and drop", + "desc": "Set the avatar shown in the navigation bar by URL, upload, or drag and drop. SVG logos are inverted automatically in dark mode; append #no-invert to the URL to disable", "label": "Avatar URL" }, "page_size": { diff --git a/client/public/locales/ja/translation.json b/client/public/locales/ja/translation.json index ade8c8135..27b8589f6 100644 --- a/client/public/locales/ja/translation.json +++ b/client/public/locales/ja/translation.json @@ -436,7 +436,7 @@ }, "avatar": { "title": "サイトアバター", - "desc": "ナビゲーションバーに表示する画像を URL、アップロード、またはドラッグ&ドロップで設定します", + "desc": "ナビゲーションバーに表示する画像を URL、アップロード、またはドラッグ&ドロップで設定します。SVG ロゴはダークモードで自動的に反転されます。無効にするには URL に #no-invert を追加してください", "label": "アバター URL" }, "page_size": { diff --git a/client/public/locales/zh-CN/translation.json b/client/public/locales/zh-CN/translation.json index eac605ea3..96b2da312 100644 --- a/client/public/locales/zh-CN/translation.json +++ b/client/public/locales/zh-CN/translation.json @@ -445,7 +445,7 @@ }, "avatar": { "title": "站点头像", - "desc": "设置显示在导航栏的头像,支持填写 URL、上传图片或拖拽上传", + "desc": "设置显示在导航栏的头像,支持填写 URL、上传图片或拖拽上传。SVG 头像在暗色模式下自动反色,URL 后加 #no-invert 可停用", "label": "头像 URL" }, "page_size": { diff --git a/client/public/locales/zh-TW/translation.json b/client/public/locales/zh-TW/translation.json index cae4da408..3a5f0ed01 100644 --- a/client/public/locales/zh-TW/translation.json +++ b/client/public/locales/zh-TW/translation.json @@ -445,7 +445,7 @@ }, "avatar": { "title": "網站頭像", - "desc": "設定顯示在導覽列的頭像,支援填寫 URL、上傳圖片或拖拽上傳", + "desc": "設定顯示在導覽列的頭像,支援填寫 URL、上傳圖片或拖拽上傳。SVG 頭像在暗色模式下自動反色,URL 後加 #no-invert 可停用", "label": "頭像 URL" }, "page_size": { diff --git a/client/src/components/admin-layout.tsx b/client/src/components/admin-layout.tsx index faa0dea18..15dfd911f 100644 --- a/client/src/components/admin-layout.tsx +++ b/client/src/components/admin-layout.tsx @@ -3,6 +3,7 @@ import { useTranslation } from "react-i18next"; import { Link, useLocation } from "wouter"; import { useSiteConfig } from "../hooks/useSiteConfig"; import { ImageWithFallback } from "./image-with-fallback"; +import { darkInvertImageClass } from "../utils/image-dark-invert"; function AdminNavItem({ href, @@ -50,7 +51,7 @@ export function AdminLayout({
{siteConfig.name}
diff --git a/client/src/components/image-upload-input.tsx b/client/src/components/image-upload-input.tsx index 44c05413b..94240eeba 100644 --- a/client/src/components/image-upload-input.tsx +++ b/client/src/components/image-upload-input.tsx @@ -7,6 +7,7 @@ import { isImageFile, uploadImageFile, } from "../utils/image-upload"; +import { darkInvertImageClass } from "../utils/image-dark-invert"; type ImageUploadInputProps = { value: string; @@ -74,6 +75,7 @@ export function ImageUploadInput({ src={value} alt={t("upload.image.preview_alt")} className="h-full w-full bg-transparent" + imageClassName={darkInvertImageClass(value)} /> ) : ( diff --git a/client/src/components/markdown_editor.tsx b/client/src/components/markdown_editor.tsx index 335d3ead0..0c89e5041 100644 --- a/client/src/components/markdown_editor.tsx +++ b/client/src/components/markdown_editor.tsx @@ -340,7 +340,7 @@ export function MarkdownEditor({ content, setContent, placeholder = "> Write you onChange={upChange} className="hidden" type="file" - accept="image/gif,image/jpeg,image/jpg,image/png" + accept="image/gif,image/jpeg,image/jpg,image/png,image/svg+xml" />