Skip to content

Commit d1d5abf

Browse files
committed
添加 logo.svg 文件并更新布局组件以支持光暗模式下的 logo 显示
1 parent 7674f57 commit d1d5abf

File tree

4 files changed

+49
-2
lines changed

4 files changed

+49
-2
lines changed

objectdocs.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
},
1414
"branding": {
1515
"logo": {
16-
"text": "ObjectStack"
16+
"text": "ObjectStack",
17+
"light": "/logo.svg",
18+
"dark": "/logo.svg"
1719
},
1820
"theme": {
1921
"accentColor": "blue",

packages/site/app/layout.config.tsx

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,32 @@
11
import { type BaseLayoutProps } from 'fumadocs-ui/layouts/shared';
22
import { siteConfig } from '@/lib/site-config';
3+
import Image from 'next/image';
34

45
export const baseOptions: BaseLayoutProps = {
56
nav: {
6-
title: siteConfig.branding.logo.text || 'ObjectStack',
7+
title: (
8+
<div className="flex items-center gap-2">
9+
{siteConfig.branding.logo.light && (
10+
<Image
11+
src={siteConfig.branding.logo.light}
12+
alt={siteConfig.branding.logo.text || 'Logo'}
13+
width={30}
14+
height={30}
15+
className={siteConfig.branding.logo.dark ? 'dark:hidden' : ''}
16+
/>
17+
)}
18+
{siteConfig.branding.logo.dark && (
19+
<Image
20+
src={siteConfig.branding.logo.dark}
21+
alt={siteConfig.branding.logo.text || 'Logo'}
22+
width={30}
23+
height={30}
24+
className="hidden dark:block"
25+
/>
26+
)}
27+
<span className="font-bold">{siteConfig.branding.logo.text || 'ObjectStack'}</span>
28+
</div>
29+
),
730
transparentMode: siteConfig.layout.navbar.transparentMode,
831
},
932
links: siteConfig.layout.navbar.links.map(link => ({

packages/site/public/logo.svg

Lines changed: 11 additions & 0 deletions
Loading

public/logo.svg

Lines changed: 11 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)