Use the giteex icon for git.djeex.fr links
This commit is contained in:
1 parent
d31a2890b7
commit
881831239f
8 files changed
+84
-6
No files matched your search
@@ -0,0 +1,56 @@
|
||||
<script setup lang="ts">
|
||||
const appConfig = useAppConfig()
|
||||
const { forced: forcedColorMode } = useDocusColorMode()
|
||||
|
||||
interface FooterLink {
|
||||
'icon': string
|
||||
'to': string
|
||||
'target': '_blank'
|
||||
'aria-label': string
|
||||
}
|
||||
|
||||
// Override of Docus's AppFooterRight: it builds `i-simple-icons-<key>` from
|
||||
// `socials`, which would show the Gitea logo for git.djeex.fr. Keys listed
|
||||
// here use our own icon instead.
|
||||
const socialIcons: Record<string, string> = {
|
||||
gitea: 'i-brand-giteex',
|
||||
}
|
||||
|
||||
const links = computed<FooterLink[]>(() => {
|
||||
const socialLinks = Object.entries(appConfig.socials || {}).flatMap(([key, url]) => {
|
||||
if (typeof url !== 'string' || !url) {
|
||||
return []
|
||||
}
|
||||
|
||||
return [{
|
||||
'icon': socialIcons[key] ?? `i-simple-icons-${key}`,
|
||||
'to': url,
|
||||
'target': '_blank' as const,
|
||||
'aria-label': `${key} social link`,
|
||||
}]
|
||||
})
|
||||
|
||||
const githubLink = appConfig.github && appConfig.github.url
|
||||
? [{
|
||||
'icon': 'i-simple-icons-github',
|
||||
'to': appConfig.github.url,
|
||||
'target': '_blank' as const,
|
||||
'aria-label': 'GitHub repository',
|
||||
}]
|
||||
: []
|
||||
|
||||
return [...socialLinks, ...githubLink]
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<template v-if="links.length">
|
||||
<UButton
|
||||
v-for="(link, index) of links"
|
||||
:key="index"
|
||||
size="sm"
|
||||
v-bind="{ color: 'neutral', variant: 'ghost', ...link }"
|
||||
/>
|
||||
</template>
|
||||
<UColorModeButton v-if="!forcedColorMode" />
|
||||
</template>
|
||||
@@ -10,7 +10,7 @@ const links = computed(() => {
|
||||
const list = []
|
||||
if (appConfig.socials?.gitea) {
|
||||
list.push({
|
||||
'icon': 'i-simple-icons-gitea',
|
||||
'icon': 'i-brand-giteex',
|
||||
'to': appConfig.socials.gitea,
|
||||
'target': '_blank',
|
||||
'aria-label': 'Gitea',
|
||||
|
||||
Reference in new issue
Block a user