Skip to content

Commit 8a4f627

Browse files
authored
chore: add redirect to herodevs site for vue 2 (#2912)
1 parent a7d0726 commit 8a4f627

File tree

3 files changed

+105
-5
lines changed

3 files changed

+105
-5
lines changed

.vitepress/theme/components/Home.vue

Lines changed: 44 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,18 @@ onMounted(load)
3838
</svg>
3939
</a>
4040
<a class="setup" href="/guide/quick-start.html">Install</a>
41+
<a class="security" href="https://v2.vuejs.org/eol/" target="_blank">
42+
Get Security Updates for Vue 2
43+
<svg
44+
class="icon"
45+
xmlns="http://www.w3.org/2000/svg"
46+
viewBox="0 0 512 512"
47+
>
48+
<path
49+
d="M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h82.7L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z"
50+
/>
51+
</svg>
52+
</a>
4153
</p>
4254
</section>
4355

@@ -145,7 +157,25 @@ html:not(.dark) .accent,
145157
transition: background-color 0.5s, color 0.5s;
146158
}
147159
148-
.actions .get-started {
160+
.actions .security {
161+
background: linear-gradient(var(--vt-c-bg-mute), var(--vt-c-bg-mute)) padding-box,
162+
linear-gradient(45deg, #42d392, #647eff) border-box;
163+
border: 2px solid transparent;
164+
}
165+
.actions .security:hover {
166+
background: linear-gradient(var(--vt-c-gray-light-4), var(--vt-c-gray-light-4)) padding-box,
167+
linear-gradient(45deg, #42d392, #647eff) border-box;
168+
}
169+
170+
.actions .security .icon {
171+
width: 12px;
172+
height: 12px;
173+
margin-left: 4px;
174+
175+
}
176+
177+
.actions .get-started,
178+
.actions .setup {
149179
margin-right: 18px;
150180
}
151181
@@ -167,18 +197,21 @@ html:not(.dark) .accent,
167197
}
168198
169199
.actions .get-started,
170-
.actions .setup {
200+
.actions .setup,
201+
.actions .security {
171202
color: var(--vt-c-text-code);
172203
}
173204
174205
.actions .get-started:hover,
175-
.actions .setup:hover {
206+
.actions .setup:hover,
207+
.actions .security:hover {
176208
background-color: var(--vt-c-gray-light-4);
177209
transition-duration: 0.2s;
178210
}
179211
180212
.dark .actions .get-started:hover,
181-
.dark .actions .setup:hover {
213+
.dark .actions .setup:hover,
214+
.dark .actions .security:hover {
182215
background-color: var(--vt-c-gray-dark-3);
183216
}
184217
@@ -267,11 +300,14 @@ html:not(.dark) .accent,
267300
}
268301
}
269302
270-
@media (max-width: 768px) {
303+
@media (max-width: 794px) {
271304
.tagline {
272305
font-size: 48px;
273306
letter-spacing: -0.5px;
274307
}
308+
.actions .security {
309+
margin-top: 18px;
310+
}
275311
}
276312
277313
@media (max-width: 576px) {
@@ -301,6 +337,9 @@ html:not(.dark) .accent,
301337
.actions a {
302338
margin: 18px 0;
303339
}
340+
.actions .security {
341+
margin-top: 0;
342+
}
304343
}
305344
306345
@media (max-width: 370px) {
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<script setup lang="ts">
2+
</script>
3+
4+
<template>
5+
<div class="container">
6+
<a
7+
class="security"
8+
href="https://www.herodevs.com/support/nes-vue?utm_source=vuejs_org&utm_medium=sidebar_link&utm_campaign=vue2eol"
9+
target="_blank"
10+
>
11+
Get Security Updates for Vue 2
12+
<svg
13+
class="icon"
14+
xmlns="http://www.w3.org/2000/svg"
15+
viewBox="0 0 512 512"
16+
>
17+
<path
18+
d="M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h82.7L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z"
19+
/>
20+
</svg>
21+
</a>
22+
</div>
23+
</template>
24+
25+
<style>
26+
.container {
27+
margin-top: 20px;
28+
}
29+
.container .security {
30+
font-size: 12px;
31+
display: inline-block;
32+
padding: 4px 8px;
33+
font-weight: 500;
34+
border-radius: 8px;
35+
background: linear-gradient(var(--vt-c-bg-mute), var(--vt-c-bg-mute)) padding-box,
36+
linear-gradient(45deg, #42d392, #647eff) border-box;
37+
border: 2px solid transparent;
38+
color: var(--vt-c-text-code);
39+
transition: background-color 0.5s, color 0.5s;
40+
}
41+
.container .security:hover {
42+
background: linear-gradient(var(--vt-c-gray-light-4), var(--vt-c-gray-light-4)) padding-box,
43+
linear-gradient(45deg, #42d392, #647eff) border-box;
44+
transition-duration: 0.2s;
45+
}
46+
.container .security .icon {
47+
width: 12px;
48+
height: 12px;
49+
margin-left: 4px;
50+
display: inline;
51+
position: relative;
52+
fill: currentColor;
53+
transition: transform 0.2s;
54+
55+
}
56+
.dark .container .security:hover {
57+
background-color: var(--vt-c-gray-dark-3);
58+
}
59+
</style>

.vitepress/theme/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import './styles/index.css'
22
import { h, App } from 'vue'
33
import { VPTheme } from '@vue/theme'
44
import PreferenceSwitch from './components/PreferenceSwitch.vue'
5+
import SecurityUpdateBtn from './components/SecurityUpdateBtn.vue'
56
import {
67
preferComposition,
78
preferSFC,
@@ -18,6 +19,7 @@ export default Object.assign({}, VPTheme, {
1819
return h(VPTheme.Layout, null, {
1920
// banner: () => h(Banner),
2021
'sidebar-top': () => h(PreferenceSwitch),
22+
'sidebar-bottom': () => h(SecurityUpdateBtn),
2123
'aside-mid': () => h(SponsorsAside)
2224
})
2325
},

0 commit comments

Comments
 (0)