Skip to content

Commit

Permalink
优化logo和siteTitle控制,改为使用站点的配置文件控制
Browse files Browse the repository at this point in the history
  • Loading branch information
Leetfs committed Sep 24, 2024
1 parent b27b30d commit 278b495
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ function countWords(content: string): number {
// https://vitepress.dev/reference/site-config
function genConfig() {
const themeConfig = useThemeContext()
const { siteTitle, githubRepoLink, nav }
const { siteTitle, githubRepoLink, nav, siteLogo, SiteTitle}
= themeConfig
return defineConfig({
lang: 'zh-CN',
Expand Down Expand Up @@ -90,11 +90,8 @@ function genConfig() {
],
themeConfig: {
// https://vitepress.dev/reference/default-theme-config
siteTitle: false,
logo: {
src: '/logo-horizontal.svg',
alt: 'Logo: RLE.wiki',
},
siteTitle: SiteTitle,
logo: siteLogo,
nav,
sidebar: generateSidebar(),
socialLinks: [{ icon: 'github', link: githubRepoLink }],
Expand Down
2 changes: 2 additions & 0 deletions src/utils/themeContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ type NavConfig = DefaultTheme.Config['nav']

export interface ThemeContext {
siteTitle: string
siteLogo: string
SiteTitle: string
siteDescription: string
githubRepoLink: string
rootDir: string
Expand Down

0 comments on commit 278b495

Please sign in to comment.