Skip to content

Commit 6f67576

Browse files
authored
style: fix Special Sponsor loading (#2590)
1 parent 1350d08 commit 6f67576

File tree

1 file changed

+18
-20
lines changed

1 file changed

+18
-20
lines changed

.vitepress/theme/components/Home.vue

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -42,28 +42,26 @@ onMounted(async () => {
4242
</p>
4343
</section>
4444

45-
<section id="special-sponsor">
45+
<section v-if="data && data.special" id="special-sponsor">
4646
<span class="lead">Special Sponsor</span>
47-
<template v-if="data && data.special">
48-
<template v-for="{ url, img, name, description } of data.special">
49-
<a :href="url" target="_blank" rel="sponsored noopener">
50-
<picture v-if="img.endsWith('png')">
51-
<source
52-
type="image/avif"
53-
:srcset="`${base}/images/${img.replace(/\.png$/, '.avif')}`"
54-
/>
55-
<img :src="`${base}/images/${img}`" :alt="name" />
56-
</picture>
57-
<img
58-
width="168"
59-
height="42"
60-
v-else
61-
:src="`${base}/images/${img}`"
62-
:alt="name"
47+
<template v-for="{ url, img, name, description } of data.special">
48+
<a :href="url" target="_blank" rel="sponsored noopener">
49+
<picture v-if="img.endsWith('png')">
50+
<source
51+
type="image/avif"
52+
:srcset="`${base}/images/${img.replace(/\.png$/, '.avif')}`"
6353
/>
64-
</a>
65-
<span>{{ description }}</span>
66-
</template>
54+
<img :src="`${base}/images/${img}`" :alt="name" />
55+
</picture>
56+
<img
57+
width="168"
58+
height="42"
59+
v-else
60+
:src="`${base}/images/${img}`"
61+
:alt="name"
62+
/>
63+
</a>
64+
<span>{{ description }}</span>
6765
</template>
6866
</section>
6967

0 commit comments

Comments
 (0)