File tree Expand file tree Collapse file tree 2 files changed +18
-1
lines changed
.vitepress/theme/components Expand file tree Collapse file tree 2 files changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,22 @@ const eventMap: Record<Placement, string> = {
45
45
function track(interest ? : boolean ) {
46
46
fathom .trackGoal (interest ? ` Y2BVYNT2 ` : eventMap [props .placement ], 0 )
47
47
}
48
+
49
+ function resolveList(data : SponsorData ) {
50
+ let currentTier = data [props .tier ]
51
+ // in aside, treat platinum+priority as special
52
+ if (props .placement === ' aside' ) {
53
+ if (props .tier === ' platinum' ) {
54
+ currentTier = currentTier .filter ((s ) => ! s .priority )
55
+ } else if (props .tier === ' special' ) {
56
+ currentTier = [
57
+ ... currentTier ,
58
+ ... data .platinum .filter ((s ) => s .priority )
59
+ ]
60
+ }
61
+ }
62
+ return currentTier
63
+ }
48
64
</script >
49
65
50
66
<template >
@@ -55,7 +71,7 @@ function track(interest?: boolean) {
55
71
>
56
72
<template v-if =" data && visible " >
57
73
<a
58
- v-for =" { url, img, name } of data[tier] "
74
+ v-for =" { url, img, name } of resolveList( data) "
59
75
class =" sponsor-item"
60
76
:href =" url"
61
77
target =" _blank"
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ export interface Sponsor {
13
13
img : string
14
14
name : string
15
15
description ?: string
16
+ priority ?: boolean
16
17
}
17
18
18
19
export interface SponsorData {
You can’t perform that action at this time.
0 commit comments