Skip to content

Commit

Permalink
feat: add sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
Cryolitia committed Dec 5, 2024
1 parent 30fa407 commit 0b4ca20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ function genConfig() {
HideLastUpdated,
HideAuthors,
rootDir,
hostName,
} = themeConfig
const additionalNav = [
{
Expand Down Expand Up @@ -114,6 +115,9 @@ function genConfig() {
lang: 'zh-CN',
title: siteTitle,
base: baseUrl,
sitemap: {
hostname: hostName,
},
cleanUrls: true,
markdown: {
config(md) {
Expand Down Expand Up @@ -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 }],
Expand Down
1 change: 1 addition & 0 deletions src/utils/themeContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface ThemeContext {
HideReadingTime?: boolean
HideLastUpdated?: boolean
HideAuthors?: boolean
hostName: string
}

const themeContext = new AsyncLocalStorage<ThemeContext>()
Expand Down

0 comments on commit 0b4ca20

Please sign in to comment.