Skip to content

Commit cee189a

Browse files
committed
Merge remote-tracking branch 'upstream/main' into main
2 parents 101a8d3 + be5fe37 commit cee189a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+1136
-282
lines changed

.vitepress/config.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ export const sidebar = {
401401
]
402402
},
403403
{
404-
text: 'Single File Component',
404+
text: 'Single-File Component',
405405
items: [
406406
{ text: 'Syntax Specification', link: '/api/sfc-spec' },
407407
{ text: '<script setup>', link: '/api/sfc-script-setup' },
@@ -560,6 +560,7 @@ export default defineConfigWithTheme<ThemeConfig>({
560560
scrollOffset: 'header',
561561

562562
head: [
563+
['meta', { name: 'theme-color', content: "#3c8772" }],
563564
['meta', { name: 'twitter:site', content: '@vuejs' }],
564565
['meta', { name: 'twitter:card', content: 'summary' }],
565566
[

.vitepress/inlined-scripts/restorePreference.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@
88
restore('vue-docs-prefer-composition', 'prefer-composition')
99
restore('vue-docs-prefer-sfc', 'prefer-sfc', true)
1010

11-
window.__VUE_BANNER_ID__ = 'wip'
11+
window.__VUE_BANNER_ID__ = 'vuejsdeConf2022'
1212
restore(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'banner-dismissed')
1313
})()

.vitepress/theme/components/Banner.vue

Lines changed: 41 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,32 @@ function dismiss() {
1919
</script>
2020

2121
<template>
22-
<div class="banner" v-if="open">
23-
Vue 3 is now the new default version!
24-
<a
25-
href="https://blog.vuejs.org/posts/vue-3-as-the-new-default.html"
26-
target="_blank"
27-
>Learn more</a
28-
>
22+
<div class="banner banner-vuejsconf" v-if="open">
23+
<a href="https://conf.vuejs.de" target="_blank">
24+
<picture>
25+
<source
26+
media="(min-width:1200px)"
27+
srcset="/images/vuejsde-conf/vuejsdeconf_banner_large.png"
28+
/>
29+
<source
30+
media="(min-width:920px)"
31+
srcset="/images/vuejsde-conf/vuejsdeconf_banner_medium.png"
32+
/>
33+
<img
34+
src="/images/vuejsde-conf/vuejsdeconf_banner_small.png"
35+
alt=""
36+
/>
37+
</picture>
38+
</a>
39+
<div class="close-btn" @click.stop.prevent="dismiss">
40+
<img src="/images/vuejsde-conf/close.svg" alt="Close" />
41+
</div>
2942
</div>
3043
</template>
3144

3245
<style>
3346
html:not(.banner-dismissed) {
34-
--vt-banner-height: 24px;
47+
--vt-banner-height: 60px;
3548
}
3649
</style>
3750

@@ -44,7 +57,7 @@ html:not(.banner-dismissed) {
4457
left: 0;
4558
right: 0;
4659
height: var(--vt-banner-height);
47-
line-height: var(--vt-banner-height);
60+
line-height: 0;
4861
text-align: center;
4962
font-size: 12px;
5063
font-weight: 600;
@@ -59,4 +72,23 @@ html:not(.banner-dismissed) {
5972
a {
6073
text-decoration: underline;
6174
}
75+
76+
.banner-vuejsconf {
77+
background: linear-gradient(90deg, #fff 50%, var(--vt-c-green) 50%);
78+
}
79+
80+
.banner-vuejsconf a {
81+
display: inline-block;
82+
margin: 0 auto;
83+
}
84+
85+
.banner-vuejsconf .close-btn {
86+
top: 26%;
87+
right: 10px;
88+
z-index: 99;
89+
position: absolute;
90+
border-radius: 50%;
91+
background-color: var(--vt-c-brand-dark);
92+
padding: 8px;
93+
}
6294
</style>

.vitepress/theme/components/Home.vue

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
11
<script setup lang="ts">
2+
import { onMounted } from 'vue';
23
import NewsLetter from './NewsLetter.vue'
4+
import { load, data, base } from './sponsors';
35
import SponsorsGroup from './SponsorsGroup.vue';
46
import VueMasteryModal from './VueMasteryModal.vue';
7+
8+
onMounted(async () => {
9+
await load()
10+
})
511
</script>
612

713
<template>
@@ -35,21 +41,20 @@ import VueMasteryModal from './VueMasteryModal.vue';
3541
</p>
3642
</section>
3743

38-
<!-- TODO make dynamic based on data -->
3944
<section id="special-sponsor">
4045
<span>Special Sponsor</span>
41-
<a href="https://www.dcloud.io/hbuilderx.html?hmsr=vue-en&hmpl=&hmcu=&hmkw=&hmci=">
42-
<picture>
43-
<source type="image/avif" srcset="/images/sponsors/hbuilder.avif" />
44-
<img
45-
alt="hbuilder logo"
46-
width="97"
47-
height="36"
48-
src="/images/sponsors/hbuilder.png"
49-
/>
50-
</picture>
51-
</a>
52-
<span>Advanced IDE for Vue</span>
46+
<template v-if="data && data.special">
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 type="image/avif" :srcset="`${base}/images/${img.replace(/\.png$/, '.avif')}`" />
51+
<img :src="`${base}/images/${img}`" :alt="name" />
52+
</picture>
53+
<img v-else :src="`${base}/images/${img}`" :alt="name" />
54+
</a>
55+
<span v-if="description">{{ description }}</span>
56+
</template>
57+
</template>
5358
</section>
5459

5560
<section id="highlights" class="vt-box-container">
@@ -181,13 +186,14 @@ html:not(.dark) .accent,
181186
font-weight: 500;
182187
font-size: 13px;
183188
vertical-align: middle;
184-
margin: 0 24px;
189+
margin-right: 24px;
185190
}
186191
187192
#special-sponsor img {
188193
display: inline-block;
189194
vertical-align: middle;
190195
height: 36px;
196+
margin-right: 24px;
191197
}
192198
193199
.dark #special-sponsor img {
@@ -279,4 +285,4 @@ html:not(.dark) .accent,
279285
font-size: 36px;
280286
}
281287
}
282-
</style>
288+
</style>

.vitepress/theme/components/SponsorsGroup.vue

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,6 @@
1-
<script lang="ts">
2-
interface Sponsor {
3-
url: string
4-
img: string
5-
name: string
6-
}
7-
8-
interface SponsorData {
9-
special: Sponsor[]
10-
platinum: Sponsor[]
11-
platinum_china: Sponsor[]
12-
gold: Sponsor[]
13-
silver: Sponsor[]
14-
bronze: Sponsor[]
15-
}
16-
17-
// shared data across instances so we load only once
18-
let data = $ref<SponsorData>()
19-
let pending = false
20-
21-
const base = `https://sponsors.vuejs.org`
22-
</script>
23-
241
<script setup lang="ts">
252
import { onMounted, onUnmounted } from 'vue'
3+
import { SponsorData, data, base, load } from './sponsors';
264
275
const { tier, placement = 'aside' } = defineProps<{
286
tier: keyof SponsorData
@@ -47,10 +25,7 @@ onMounted(async () => {
4725
onUnmounted(() => observer.disconnect())
4826
4927
// load data
50-
if (!pending) {
51-
pending = true
52-
data = await (await fetch(`${base}/data.json`)).json()
53-
}
28+
await load()
5429
})
5530
</script>
5631

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// shared data across instances so we load only once
2+
3+
import { ref } from 'vue'
4+
5+
export interface Sponsor {
6+
url: string
7+
img: string
8+
name: string
9+
description?: string
10+
}
11+
12+
export interface SponsorData {
13+
special: Sponsor[]
14+
platinum: Sponsor[]
15+
platinum_china: Sponsor[]
16+
gold: Sponsor[]
17+
silver: Sponsor[]
18+
bronze: Sponsor[]
19+
}
20+
21+
export const data = ref<SponsorData>()
22+
export const pending = ref<boolean>(false)
23+
24+
export const base = `https://sponsors.vuejs.org`
25+
26+
export const load = async () => {
27+
if (!pending.value) {
28+
pending.value = true
29+
data.value = await (await fetch(`${base}/data.json`)).json()
30+
}
31+
}

.vitepress/theme/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,15 @@ import {
88
filterHeadersByPreference
99
} from './components/preferences'
1010
import SponsorsAside from './components/SponsorsAside.vue'
11-
import VueSchoolLink from './components/VueSchoolLink.vue'
1211
import VueJobs from './components/VueJobs.vue'
12+
import VueSchoolLink from './components/VueSchoolLink.vue'
13+
import Banner from './components/Banner.vue'
1314

1415
export default Object.assign({}, VPTheme, {
1516
Layout: () => {
1617
// @ts-ignore
1718
return h(VPTheme.Layout, null, {
19+
banner: () => h(Banner),
1820
'sidebar-top': () => h(PreferenceSwitch),
1921
'aside-mid': () => h(SponsorsAside),
2022
'aside-bottom': () => h(VueJobs)

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
"preinstall": "npx only-allow pnpm"
1010
},
1111
"dependencies": {
12-
"@vue/repl": "^1.0.0",
13-
"@vue/theme": "^1.0.2",
12+
"@vue/repl": "^1.2.4",
13+
"@vue/theme": "^1.0.4",
1414
"dynamics.js": "^1.1.5",
1515
"gsap": "^3.9.0",
1616
"vitepress": "^0.22.4",
17-
"vue": "^3.2.33"
17+
"vue": "^3.2.37"
1818
},
1919
"devDependencies": {
2020
"@types/markdown-it": "^12.2.3",

0 commit comments

Comments
 (0)