Skip to content

Commit

Permalink
fix: add sitemap
Browse files Browse the repository at this point in the history
  • Loading branch information
brenoepics authored May 29, 2024
1 parent c07883f commit 2742340
Showing 1 changed file with 57 additions and 46 deletions.
103 changes: 57 additions & 46 deletions demo/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -4,59 +4,23 @@ import baseConfig from '../../src/theme/config/baseConfig'
import type { ThemeConfig } from '../../src'
import { DefaultTheme } from 'vitepress/theme'

const guideGroupItems = [
{ text: 'Introduction', link: '/guide/introduction' },
{ text: 'Getting Started', link: '/guide/getting-started' },
{ text: 'Configuration', link: '/guide/configuration' }
]

const themeGroupItems = [
{ text: 'Extending', link: '/guide/extending-theme' }
]

const componentGroupItems = [
{ text: 'Home', link: '/guide/home-component' }
]

const examplesItems = [
{ text: 'Markdown Examples', link: '/examples/markdown-examples' },
{ text: 'Runtime API Examples', link: '/examples/api-examples' }
]

const nav: DefaultTheme.NavItem[] = [
{
text: 'Guide',
activeMatch: `^/guide/`,
items: [
{ text: 'Guide', items: guideGroupItems },
{ text: 'Theme', items: themeGroupItems },
{ text: 'Components', items: componentGroupItems }
]
},
{
text: 'Examples',
activeMatch: `^/examples/`,
items: examplesItems
}, {
text: 'VitePress',
link: `https://vitepress.dev`
}
]

const sidebar = [
{ text: 'Guide', items: guideGroupItems },
{ text: 'Theme', items: themeGroupItems },
{ text: 'Components', items: componentGroupItems },
{ text: 'Examples', items: examplesItems }
]

export default defineConfigWithTheme<ThemeConfig>({
extends: baseConfig,

lang: 'en-US',
title: 'VitePress Carbon',
description: 'Carbon embraces GitHub\'s monochromatic ethos, offering a theme for VitePress documentation that is sleek, modern, and effortlessly stylish.',
srcDir: 'src',
lastUpdated: true,
cleanUrls: true,
metaChunk: true,

sitemap: {
hostname: 'carbon.breno.tech',
transformItems(items) {
return items.filter((item) => !item.url.includes('migration'))
}
},
themeConfig: {
nav,
sidebar,
Expand Down Expand Up @@ -107,3 +71,50 @@ export default defineConfigWithTheme<ThemeConfig>({
}
}
})

const guideGroupItems = [
{ text: 'Introduction', link: '/guide/introduction' },
{ text: 'Getting Started', link: '/guide/getting-started' },
{ text: 'Configuration', link: '/guide/configuration' }
]

const themeGroupItems = [
{ text: 'Extending', link: '/guide/extending-theme' }
]

const componentGroupItems = [
{ text: 'Home', link: '/guide/home-component' }
]

const examplesItems = [
{ text: 'Markdown Examples', link: '/examples/markdown-examples' },
{ text: 'Runtime API Examples', link: '/examples/api-examples' }
]

const nav: DefaultTheme.NavItem[] = [
{
text: 'Guide',
activeMatch: `^/guide/`,
items: [
{ text: 'Guide', items: guideGroupItems },
{ text: 'Theme', items: themeGroupItems },
{ text: 'Components', items: componentGroupItems }
]
},
{
text: 'Examples',
activeMatch: `^/examples/`,
items: examplesItems
}, {
text: 'VitePress',
link: `https://vitepress.dev`
}
]

const sidebar = [
{ text: 'Guide', items: guideGroupItems },
{ text: 'Theme', items: themeGroupItems },
{ text: 'Components', items: componentGroupItems },
{ text: 'Examples', items: examplesItems }
]

0 comments on commit 2742340

Please sign in to comment.