Skip to content

Commit

Permalink
docs: update group icon plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
yuyinws committed Aug 20, 2024
1 parent 6d5291e commit 4382618
Show file tree
Hide file tree
Showing 9 changed files with 854 additions and 1,127 deletions.
16 changes: 14 additions & 2 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { defineConfig } from 'vitepress'
import { transformerTwoslash } from '@shikijs/vitepress-twoslash'
import { groupIconPlugin } from 'vitepress-plugin-group-icons'
import Unocss from 'unocss/vite'
import { groupIconMdPlugin, groupIconVitePlugin, localIconLoader } from 'vitepress-plugin-group-icons'
import { zhCN } from './zhCN'
import { enUS } from './enUS'

Expand Down Expand Up @@ -37,7 +38,7 @@ export default defineConfig({
lazyLoading: true,
},
config(md) {
md.use(groupIconPlugin as any)
md.use(groupIconMdPlugin)
},
},
head: [
Expand All @@ -51,4 +52,15 @@ export default defineConfig({
['link', { rel: 'icon', type: 'image/svg+xml', href: '/logo.svg' }],
['meta', { name: 'theme-color', content: '#4FC08D' }],
],
vite: {
plugins: [
groupIconVitePlugin({
customIcon: {
rspack: localIconLoader(import.meta.url, './assets/icons/rspack.svg'),
farm: localIconLoader(import.meta.url, './assets/icons/farm.svg'),
},
}),
Unocss(),
],
},
})
8 changes: 1 addition & 7 deletions docs/.vitepress/theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,13 @@ import 'uno.css'
import TwoslashFloatingVue from '@shikijs/vitepress-twoslash/client'
import '@shikijs/vitepress-twoslash/style.css'
import type { EnhanceAppContext } from 'vitepress'
import { GroupIconComponent } from 'vitepress-plugin-group-icons/client'
import rspack from '../assets/icons/rspack.svg?raw'
import farm from '../assets/icons/farm.svg?raw'
import Layout from './Layout.vue'
import 'virtual:group-icons.css'

export default {
...Theme,
Layout,
enhanceApp({ app }: EnhanceAppContext) {
app.use(TwoslashFloatingVue)
app.use(GroupIconComponent, {
rspack,
farm,
})
},
}
7 changes: 4 additions & 3 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
},
"devDependencies": {
"@iconify-json/logos": "^1.1.44",
"@shikijs/vitepress-twoslash": "^1.12.1",
"@shikijs/vitepress-twoslash": "^1.14.1",
"case-police": "^0.6.1",
"unocss": "^0.61.9",
"unplugin-turbo-console": "workspace:*",
"vitepress": "^1.3.2",
"vitepress-plugin-group-icons": "^0.0.9"
"vite-plugin-inspect": "^0.8.4",
"vitepress": "^1.3.3",
"vitepress-plugin-group-icons": "1.0.0-beta.5"
}
}
8 changes: 0 additions & 8 deletions docs/vite.config.ts

This file was deleted.

2 changes: 1 addition & 1 deletion examples/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"svelte-check": "^3.8.1",
"tslib": "^2.6.3",
"typescript": "^5.4.5",
"vite": "^5.3.1",
"vite": "catalog:",
"unplugin-turbo-console": "workspace:*"
},
"type": "module"
Expand Down
2 changes: 1 addition & 1 deletion examples/vite-vue3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"npm-run-all2": "^6.2.0",
"typescript": "~5.4.5",
"unplugin-turbo-console": "workspace:*",
"vite": "^5.3.1",
"vite": "catalog:",
"vite-plugin-inspect": "^0.8.4",
"vue-tsc": "^2.0.21"
}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
"tsx": "^4.16.2",
"typescript": "^5.5.3",
"unbuild": "3.0.0-rc.6",
"vite": "^5.3.3",
"vite": "catalog:",
"vite-plugin-inspect": "^0.8.4",
"vitest": "^2.0.1",
"vue": "^3.4.31",
Expand Down
Loading

0 comments on commit 4382618

Please sign in to comment.