File tree 2 files changed +27
-3
lines changed
src/client/theme-default/components
2 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
+ import { computed } from ' vue'
2
3
import { useData } from ' ../composables/data'
3
4
import { useLangs } from ' ../composables/langs'
4
5
import { useSidebar } from ' ../composables/sidebar'
@@ -8,11 +9,34 @@ import VPImage from './VPImage.vue'
8
9
const { site, theme } = useData ()
9
10
const { hasSidebar } = useSidebar ()
10
11
const { currentLang } = useLangs ()
12
+
13
+ const link = computed (() =>
14
+ typeof theme .value .logoLink === ' string'
15
+ ? theme .value .logoLink
16
+ : theme .value .logoLink ?.link
17
+ )
18
+
19
+ const rel = computed (() =>
20
+ typeof theme .value .logoLink === ' string'
21
+ ? undefined
22
+ : theme .value .logoLink ?.rel
23
+ )
24
+
25
+ const target = computed (() =>
26
+ typeof theme .value .logoLink === ' string'
27
+ ? undefined
28
+ : theme .value .logoLink ?.target
29
+ )
11
30
</script >
12
31
13
32
<template >
14
33
<div class =" VPNavBarTitle" :class =" { 'has-sidebar': hasSidebar }" >
15
- <a class =" title" :href =" theme.logoLink ?? normalizeLink(currentLang.link)" >
34
+ <a
35
+ class =" title"
36
+ :href =" link ?? normalizeLink(currentLang.link)"
37
+ :rel =" rel"
38
+ :target =" target"
39
+ >
16
40
<slot name =" nav-bar-title-before" />
17
41
<VPImage v-if =" theme.logo" class =" logo" :image =" theme.logo" />
18
42
<template v-if =" theme .siteTitle " >{{ theme.siteTitle }}</template >
Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ export namespace DefaultTheme {
20
20
/**
21
21
* Overrides the link of the site logo.
22
22
*/
23
- logoLink ?: string
23
+ logoLink ?: string | { link ?: string ; rel ?: string ; target ?: string }
24
24
25
25
/**
26
26
* Custom site title in navbar. If the value is undefined,
@@ -174,8 +174,8 @@ export namespace DefaultTheme {
174
174
* RegExp object here because it isn't serializable
175
175
*/
176
176
activeMatch ?: string
177
- target ?: string
178
177
rel ?: string
178
+ target ?: string
179
179
}
180
180
181
181
export interface NavItemChildren {
You can’t perform that action at this time.
0 commit comments