Skip to content

Commit 3fbc175

Browse files
committed
MERGE FROM UPSTREAM 2023.02.06
1 parent 6742e14 commit 3fbc175

35 files changed

+1141
-785
lines changed

ko-KR/.vitepress/config.ts

Lines changed: 54 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import type { Config as ThemeConfig } from '@vue/theme'
55
import baseConfig from '@vue/theme/config'
66
import { headerPlugin } from './headerMdPlugin'
77

8-
const nav = [
8+
const nav: ThemeConfig['nav'] = [
99
{
1010
text: '문서',
1111
activeMatch: `^/(guide|style-guide|cookbook|examples)/`,
@@ -35,15 +35,14 @@ const nav = [
3535
link: 'https://sfc.vuejs.org'
3636
},
3737
{
38-
text: '생태계',
38+
text: 'Ecosystem',
3939
activeMatch: `^/ecosystem/`,
4040
items: [
4141
{
4242
text: 'Resources',
4343
items: [
44-
{ text: 'Sponsor', link: 'https://vuejs.org/sponsor/' },
45-
{ text: 'Partners', link: 'https://vuejs.org/partners/' },
46-
{ text: 'Themes', link: 'https://vuejs.org/ecosystem/themes/' },
44+
{ text: 'Partners', link: '/partners/' },
45+
{ text: 'Themes', link: '/ecosystem/themes' },
4746
{ text: 'Jobs', link: 'https://vuejobs.com/?ref=vuejs' },
4847
{ text: 'T-Shirt Shop', link: 'https://vue.threadless.com/' }
4948
]
@@ -52,10 +51,10 @@ const nav = [
5251
text: '핵심 라이브러리',
5352
items: [
5453
{ text: 'Vue 라우터', link: 'https://router.vuejs.kr/' },
55-
{ text: '피니아 (상태 관리)', link: 'https://pinia.vuejs.kr/' }
54+
{ text: '피니아 (상태 관리)', link: 'https://pinia.vuejs.kr/' },
55+
{ text: '도구 가이드', link: '/guide/scaling-up/tooling.html' }
5656
]
5757
},
58-
5958
{
6059
text: '비디오 코스',
6160
items: [
@@ -88,8 +87,8 @@ const nav = [
8887
items: [
8988
{ text: '블로그', link: 'https://blog.vuejs.org/' },
9089
{ text: '트위터', link: 'https://twitter.com/vuejs' },
91-
{ text: '뉴스레터', link: 'https://news.vuejs.org/' },
92-
{ text: '이벤트', link: 'https://events.vuejs.org/' }
90+
{ text: '이벤트', link: 'https://events.vuejs.org/' },
91+
{ text: '뉴스레터', link: '/ecosystem/newsletters' }
9392
]
9493
}
9594
]
@@ -98,23 +97,32 @@ const nav = [
9897
text: 'About',
9998
activeMatch: `^/about/`,
10099
items: [
101-
{ text: 'FAQ', link: 'https://vuejs.org/about/faq/' },
102-
{ text: 'Team', link: 'https://vuejs.org/about/team' },
103-
{ text: 'Releases', link: 'https://vuejs.org/about/releases' },
100+
{ text: 'FAQ', link: '/about/faq' },
101+
{ text: 'Team', link: '/about/team' },
102+
{ text: 'Releases', link: '/about/releases' },
104103
{
105104
text: 'Community Guide',
106-
link: 'https://vuejs.org/about/community-guide'
105+
link: '/about/community-guide'
107106
},
108-
{ text: 'Code of Conduct', link: 'https://vuejs.org/about/coc' },
107+
{ text: 'Code of Conduct', link: '/about/coc' },
109108
{
110109
text: 'The Documentary',
111110
link: 'https://www.youtube.com/watch?v=OrxmtDw4pVI'
112111
}
113112
]
113+
},
114+
{
115+
text: 'Sponsor',
116+
link: '/sponsor/'
117+
},
118+
{
119+
text: 'Partners',
120+
link: '/partners/',
121+
activeMatch: `^/partners/`
114122
}
115123
]
116124

117-
export const sidebar = {
125+
export const sidebar: ThemeConfig['sidebar'] = {
118126
'/guide/': [
119127
{
120128
text: '시작하기',
@@ -180,6 +188,7 @@ export const sidebar = {
180188
},
181189
{ text: 'Props', link: '/guide/components/props' },
182190
{ text: '이벤트', link: '/guide/components/events' },
191+
{ text: 'Component v-model', link: '/guide/components/v-model' },
183192
{
184193
text: '폴스루 속성',
185194
link: '/guide/components/attrs'
@@ -542,6 +551,10 @@ export const sidebar = {
542551
]
543552
}
544553

554+
// Placeholder of the i18n config for @vuejs-translations.
555+
// const i18n: ThemeConfig['i18n'] = {
556+
// }
557+
545558
export default defineConfigWithTheme<ThemeConfig>({
546559
extends: baseConfig,
547560

@@ -554,7 +567,7 @@ export default defineConfigWithTheme<ThemeConfig>({
554567
scrollOffset: 'header',
555568

556569
head: [
557-
['meta', { name: 'theme-color', content: "#3c8772" }],
570+
['meta', { name: 'theme-color', content: '#3c8772' }],
558571
['meta', { name: 'twitter:site', content: '@vuejs' }],
559572
['meta', { name: 'twitter:card', content: 'summary' }],
560573
[
@@ -593,6 +606,31 @@ export default defineConfigWithTheme<ThemeConfig>({
593606
themeConfig: {
594607
nav,
595608
sidebar,
609+
// Placeholder of the i18n config for @vuejs-translations.
610+
// i18n,
611+
612+
localeLinks: [
613+
{
614+
link: 'https://cn.vuejs.org',
615+
text: '简体中文',
616+
repo: 'https://github.com/vuejs-translations/docs-zh-cn'
617+
},
618+
{
619+
link: 'https://ja.vuejs.org',
620+
text: '日本語',
621+
repo: 'https://github.com/vuejs-translations/docs-ja'
622+
},
623+
{
624+
link: 'https://ko.vuejs.org',
625+
text: '한국어',
626+
repo: 'https://github.com/vuejs-translations/docs-ko'
627+
},
628+
{
629+
link: '/translations/',
630+
text: 'Help Us Translate!',
631+
isTranslationsDesc: true
632+
}
633+
],
596634

597635
algolia: {
598636

@@ -610,7 +648,6 @@ export default defineConfigWithTheme<ThemeConfig>({
610648
// },
611649

612650
socialLinks: [
613-
{ icon: 'languages', link: '/translations/' },
614651
{ icon: 'github', link: 'https://github.com/vuejs-kr/docs-next' },
615652
{ icon: 'twitter', link: 'https://twitter.com/vuejs' },
616653
{ icon: 'discord', link: 'https://discord.com/invite/HBherRA' }

ko-KR/.vitepress/headerMdPlugin.ts

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -11,39 +11,47 @@
1111
*/
1212

1313
import MarkdownIt from 'markdown-it'
14-
import { MarkdownRenderer } from 'vitepress'
14+
import { Header } from 'vitepress'
1515

16-
declare module 'vitepress' {
17-
interface Header {
18-
compositionOnly?: boolean
19-
optionsOnly?: boolean
20-
}
16+
export interface AugmentedHeader extends Header {
17+
compositionOnly?: boolean
18+
optionsOnly?: boolean
2119
}
2220

2321
export const headerPlugin = (md: MarkdownIt) => {
24-
const originalOpen = md.renderer.rules.heading_open!
25-
md.renderer.rules.heading_open = (tokens, i, ...rest) => {
22+
md.renderer.rules.heading_open = (tokens, i, options, env, self) => {
2623
for (const child of tokens[i + 1].children!) {
2724
if (child.type === 'text' && child.content.endsWith('*')) {
2825
child.content = child.content.replace(/\s*\*+$/, '')
2926
}
3027
}
31-
return originalOpen.call(null, tokens, i, ...rest)
28+
return self.renderToken(tokens, i, options)
29+
}
30+
31+
const render = md.render
32+
md.render = (content, env) => {
33+
const res = render(content, env)
34+
35+
if (env && env.headers) {
36+
processHeaders(env.headers)
37+
}
38+
39+
return res
3240
}
41+
}
3342

34-
md.renderer.rules.heading_close = (tokens, i, options, _env, self) => {
35-
const headers = (md as MarkdownRenderer).__data?.headers
36-
if (headers) {
37-
const last = headers[headers.length - 1]
38-
if (last.title.endsWith('*')) {
39-
if (last.title.endsWith('**')) {
40-
last.compositionOnly = true
41-
} else {
42-
last.optionsOnly = true
43-
}
44-
last.title = last.title.replace(/\s*\*+$/, '')
43+
function processHeaders(headers: AugmentedHeader[]) {
44+
for (const h of headers) {
45+
if (h.title.endsWith('*')) {
46+
if (h.title.endsWith('**')) {
47+
h.compositionOnly = true
48+
} else {
49+
h.optionsOnly = true
4550
}
51+
h.title = h.title.replace(/\s*\*+$/, '')
52+
}
53+
if (h.children) {
54+
processHeaders(h.children)
4655
}
47-
return self.renderToken(tokens, i, options)
4856
}
4957
}

ko-KR/.vitepress/inlined-scripts/restorePreference.js

Lines changed: 2 additions & 2 deletions
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__ = 'vuejsdeConf2022'
12-
restore(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'banner-dismissed')
11+
// window.__VUE_BANNER_ID__ = ''
12+
// restore(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'banner-dismissed')
1313
})()

ko-KR/.vitepress/jobsMdPlugin.ts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import MarkdownIt from 'markdown-it'
2+
3+
const excludedPages = [
4+
'guide/introduction.md',
5+
'guide/quick-start.md',
6+
'guide/essentials/computed.md',
7+
'guide/essentials/conditional.md',
8+
'guide/essentials/list.md',
9+
'guide/essentials/event-handling.md',
10+
'guide/essentials/forms.md',
11+
'guide/components/registration.md',
12+
'guide/components/props.md',
13+
'guide/components/events.md',
14+
'guide/components/slots.md',
15+
'guide/built-ins/teleport.md',
16+
'about/faq.md',
17+
'about/team.md',
18+
'about/releases.md',
19+
'about/community-guide.md',
20+
'about/coc.md',
21+
'sponsor/index.md',
22+
'translations/index.md'
23+
]
24+
25+
export const jobsPlugin = (md: MarkdownIt) => {
26+
md.renderer.rules.heading_close = (tokens, i, options, env, self) => {
27+
const relativePath = env.relativePath
28+
const renderedContent = self.renderToken(tokens, i, options)
29+
30+
return excludedPages.includes(relativePath)
31+
? renderedContent
32+
: renderedContent.replace(/<\/h1>/, '</h1><VueJobs/>')
33+
}
34+
}

ko-KR/.vitepress/theme/components/Banner.vue

Lines changed: 1 addition & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88
99
let open = $ref(true)
10-
1110
/**
1211
* Call this if the banner is dismissible
1312
*/
@@ -19,27 +18,7 @@ function dismiss() {
1918
</script>
2019

2120
<template>
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>
42-
</div>
21+
<div class="banner" v-if="open"></div>
4322
</template>
4423

4524
<style>
@@ -68,27 +47,4 @@ html:not(.banner-dismissed) {
6847
.banner-dismissed .banner {
6948
display: none;
7049
}
71-
72-
a {
73-
text-decoration: underline;
74-
}
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-
}
9450
</style>

0 commit comments

Comments
 (0)