Skip to content

Commit

Permalink
fix: allow social icons to be a full URL (#923)
Browse files Browse the repository at this point in the history
Co-authored-by: Sébastien Chopin <seb@nuxtlabs.com>
Co-authored-by: Sébastien Chopin <seb@nuxt.com>
  • Loading branch information
3 people committed Jun 30, 2023
1 parent 7d145cc commit 76c36b3
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
17 changes: 7 additions & 10 deletions .starters/default/app.config.ts
Expand Up @@ -4,8 +4,13 @@ export default defineAppConfig({
description: 'The best place to start your documentation.',
image: 'https://user-images.githubusercontent.com/904724/185365452-87b7ca7b-6030-4813-a2db-5e65c785bf88.png',
socials: {
twitter: 'nuxtstudio',
github: 'nuxt-themes/docus'
twitter: 'nuxt_js',
github: 'nuxt-themes/docus',
nuxt: {
label: 'Nuxt',
icon: 'simple-icons:nuxtdotjs',
href: 'https://nuxt.com'
}
},
github: {
dir: '.starters/default/content',
Expand All @@ -28,14 +33,6 @@ export default defineAppConfig({
showLinkIcon: true,
exclude: [],
fluid: true
},
footer: {
iconLinks: [
{
href: 'https://nuxt.com',
icon: 'simple-icons:nuxtdotjs'
}
]
}
}
})
4 changes: 2 additions & 2 deletions .starters/default/content/1.introduction/4.configuration.md
Expand Up @@ -22,8 +22,8 @@ export default defineAppConfig({
url: 'http://docus.dev',
image: '/social-card-preview.png',
socials: {
twitter: '@docus_',
github: 'nuxtlabs/docus',
twitter: '@nuxt_js',
github: 'nuxt-themes/docus',
},
github: {
root: 'content',
Expand Down
2 changes: 1 addition & 1 deletion components/app/AppSocialIcons.vue
Expand Up @@ -10,7 +10,7 @@ const icons = computed<any>(() => {
return value
} else if (typeof value === 'string' && value && socials.includes(key)) {
return {
href: `https://${key}.com/${value}`,
href: /^https?:\/\//.test(value) ? value : `https://${key}.com/${value}`,
icon: `fa-brands:${key}`,
label: value,
rel: 'noopener noreferrer'
Expand Down

0 comments on commit 76c36b3

Please sign in to comment.