Skip to content

Commit

Permalink
docs: add code group icon (unocss#4077)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyinws authored Aug 16, 2024
1 parent 8006de8 commit f438190
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 72 deletions.
4 changes: 4 additions & 0 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig } from 'vitepress'
import type { DefaultTheme } from 'vitepress/types'
import { transformerTwoslash } from '@shikijs/vitepress-twoslash'
import { groupIconPlugin } from 'vitepress-plugin-group-icons'
import { version } from '../../package.json'

const ogUrl = 'https://unocss.dev/'
Expand Down Expand Up @@ -281,6 +282,9 @@ export default defineConfig({
processHoverInfo: info => info.replace(/_unocss_core\./g, ''),
}),
],
config(md) {
md.use(groupIconPlugin)
},
},

themeConfig: {
Expand Down
2 changes: 2 additions & 0 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { h, watch } from 'vue'
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import TwoslashFloatingVue from '@shikijs/vitepress-twoslash/client'
import { GroupIconComponent } from 'vitepress-plugin-group-icons/client'
import UnoCSSLayout from './UnoCSSLayout.vue'
import RainbowAnimationSwitcher from './components/RainbowAnimationSwitcher.vue'

Expand All @@ -23,6 +24,7 @@ export default {
enhanceApp({ app, router }) {
app.component('RainbowAnimationSwitcher', RainbowAnimationSwitcher)
app.use(TwoslashFloatingVue)
app.use(GroupIconComponent)

if (typeof window === 'undefined')
return
Expand Down
3 changes: 2 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@iconify-json/vscode-icons": "^1.1.37",
"ofetch": "^1.3.4",
"unocss": "workspace:*",
"vitepress": "^1.3.2"
"vitepress": "^1.3.2",
"vitepress-plugin-group-icons": "^0.0.9"
}
}
Loading

0 comments on commit f438190

Please sign in to comment.