Skip to content

Commit 05f2f0d

Browse files
authored
feat: on demand social icons (#4339)
1 parent 602ae7b commit 05f2f0d

File tree

15 files changed

+170
-146
lines changed

15 files changed

+170
-146
lines changed

docs/en/reference/default-theme-config.md

+2-15
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ You may define this option to show your social account links with icons in nav.
228228
export default {
229229
themeConfig: {
230230
socialLinks: [
231+
// You can add any icon from simple-icons (https://simpleicons.org/):
231232
{ icon: 'github', link: 'https://github.com/vuejs/vitepress' },
232233
{ icon: 'twitter', link: '...' },
233234
// You can also add custom icons by passing SVG as string:
@@ -246,24 +247,10 @@ export default {
246247

247248
```ts
248249
interface SocialLink {
249-
icon: SocialLinkIcon
250+
icon: string | { svg: string }
250251
link: string
251252
ariaLabel?: string
252253
}
253-
254-
type SocialLinkIcon =
255-
| 'discord'
256-
| 'facebook'
257-
| 'github'
258-
| 'instagram'
259-
| 'linkedin'
260-
| 'mastodon'
261-
| 'npm'
262-
| 'slack'
263-
| 'twitter'
264-
| 'x'
265-
| 'youtube'
266-
| { svg: string }
267254
```
268255

269256
## footer

docs/es/reference/default-theme-config.md

+1-15
Original file line numberDiff line numberDiff line change
@@ -233,24 +233,10 @@ export default {
233233

234234
```ts
235235
interface SocialLink {
236-
icon: SocialLinkIcon
236+
icon: string | { svg: string }
237237
link: string
238238
ariaLabel?: string
239239
}
240-
241-
type SocialLinkIcon =
242-
| 'discord'
243-
| 'facebook'
244-
| 'github'
245-
| 'instagram'
246-
| 'linkedin'
247-
| 'mastodon'
248-
| 'npm'
249-
| 'slack'
250-
| 'twitter'
251-
| 'x'
252-
| 'youtube'
253-
| { svg: string }
254240
```
255241

256242
## footer

docs/ko/reference/default-theme-config.md

+1-15
Original file line numberDiff line numberDiff line change
@@ -246,24 +246,10 @@ export default {
246246

247247
```ts
248248
interface SocialLink {
249-
icon: SocialLinkIcon
249+
icon: string | { svg: string }
250250
link: string
251251
ariaLabel?: string
252252
}
253-
254-
type SocialLinkIcon =
255-
| 'discord'
256-
| 'facebook'
257-
| 'github'
258-
| 'instagram'
259-
| 'linkedin'
260-
| 'mastodon'
261-
| 'npm'
262-
| 'slack'
263-
| 'twitter'
264-
| 'x'
265-
| 'youtube'
266-
| { svg: string }
267253
```
268254

269255
## footer

docs/pt/reference/default-theme-config.md

+1-15
Original file line numberDiff line numberDiff line change
@@ -233,24 +233,10 @@ export default {
233233

234234
```ts
235235
interface SocialLink {
236-
icon: SocialLinkIcon
236+
icon: string | { svg: string }
237237
link: string
238238
ariaLabel?: string
239239
}
240-
241-
type SocialLinkIcon =
242-
| 'discord'
243-
| 'facebook'
244-
| 'github'
245-
| 'instagram'
246-
| 'linkedin'
247-
| 'mastodon'
248-
| 'npm'
249-
| 'slack'
250-
| 'twitter'
251-
| 'x'
252-
| 'youtube'
253-
| { svg: string }
254240
```
255241

256242
## footer

docs/ru/reference/default-theme-config.md

+1-15
Original file line numberDiff line numberDiff line change
@@ -233,24 +233,10 @@ export default {
233233

234234
```ts
235235
interface SocialLink {
236-
icon: SocialLinkIcon
236+
icon: string | { svg: string }
237237
link: string
238238
ariaLabel?: string
239239
}
240-
241-
type SocialLinkIcon =
242-
| 'discord'
243-
| 'facebook'
244-
| 'github'
245-
| 'instagram'
246-
| 'linkedin'
247-
| 'mastodon'
248-
| 'npm'
249-
| 'slack'
250-
| 'twitter'
251-
| 'x'
252-
| 'youtube'
253-
| { svg: string }
254240
```
255241

256242
## footer {#footer}

docs/zh/reference/default-theme-config.md

+1-15
Original file line numberDiff line numberDiff line change
@@ -233,24 +233,10 @@ export default {
233233

234234
```ts
235235
interface SocialLink {
236-
icon: SocialLinkIcon
236+
icon: string | { svg: string }
237237
link: string
238238
ariaLabel?: string
239239
}
240-
241-
type SocialLinkIcon =
242-
| 'discord'
243-
| 'facebook'
244-
| 'github'
245-
| 'instagram'
246-
| 'linkedin'
247-
| 'mastodon'
248-
| 'npm'
249-
| 'slack'
250-
| 'twitter'
251-
| 'x'
252-
| 'youtube'
253-
| { svg: string }
254240
```
255241

256242
## footer

package.json

+2
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@
100100
"dependencies": {
101101
"@docsearch/css": "^3.6.2",
102102
"@docsearch/js": "^3.6.2",
103+
"@iconify-json/simple-icons": "^1.2.10",
103104
"@shikijs/core": "^1.22.2",
104105
"@shikijs/transformers": "^1.22.2",
105106
"@shikijs/types": "^1.22.2",
@@ -118,6 +119,7 @@
118119
},
119120
"devDependencies": {
120121
"@clack/prompts": "^0.7.0",
122+
"@iconify/utils": "^2.1.33",
121123
"@mdit-vue/plugin-component": "^2.1.3",
122124
"@mdit-vue/plugin-frontmatter": "^2.1.3",
123125
"@mdit-vue/plugin-headers": "^2.1.3",

0 commit comments

Comments
 (0)