diff --git a/src/config.ts b/src/config.ts index 837daf8..e0fe877 100644 --- a/src/config.ts +++ b/src/config.ts @@ -65,6 +65,7 @@ function genConfig() { HideLastUpdated, HideAuthors, rootDir, + hostName, } = themeConfig const additionalNav = [ { @@ -114,6 +115,9 @@ function genConfig() { lang: 'zh-CN', title: siteTitle, base: baseUrl, + sitemap: { + hostname: hostName, + }, cleanUrls: true, markdown: { config(md) { @@ -164,6 +168,9 @@ function genConfig() { // https://vitepress.dev/reference/default-theme-config siteTitle: SiteTitle, logo: siteLogo, + sitemap: { + hostname: hostName, + }, nav: combinedNav, sidebar: generateSidebar(), socialLinks: [{ icon: 'github', link: githubRepoLink }], diff --git a/src/utils/themeContext.ts b/src/utils/themeContext.ts index 81e28bb..a029799 100644 --- a/src/utils/themeContext.ts +++ b/src/utils/themeContext.ts @@ -22,6 +22,7 @@ export interface ThemeContext { HideReadingTime?: boolean HideLastUpdated?: boolean HideAuthors?: boolean + hostName: string } const themeContext = new AsyncLocalStorage()