Skip to content

Commit 719cde5

Browse files
committed
Merge remote-tracking branch 'origin/upstream' into sync
2 parents ec9b0a9 + d4527e0 commit 719cde5

File tree

86 files changed

+3594
-2837
lines changed

Some content is hidden

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

86 files changed

+3594
-2837
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ dist/
9898
# vitepress build output
9999
.vitepress/dist
100100
.vitepress/cache
101+
.vitepress/.temp
101102

102103
# Serverless directories
103104
.serverless/

.vitepress/config.ts

Lines changed: 66 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
1+
import fs from 'fs'
2+
import path from 'path'
3+
import { defineConfigWithTheme, type HeadConfig, type Plugin } from 'vitepress'
14
import type { Config as ThemeConfig } from '@vue/theme'
5+
import llmstxt from 'vitepress-plugin-llms'
26
import baseConfig from '@vue/theme/config'
37
import { defineConfigWithTheme } from 'vitepress'
48
import fs from 'fs'
59
import { headerPlugin } from './headerMdPlugin'
610
import path from 'path'
711
// import { textAdPlugin } from './textAdMdPlugin'
12+
import { groupIconMdPlugin, groupIconVitePlugin } from 'vitepress-plugin-group-icons'
813

914
const nav: ThemeConfig['nav'] = [
1015
{
@@ -181,15 +186,15 @@ export const sidebar: ThemeConfig['sidebar'] = {
181186
link: '/guide/essentials/event-handling'
182187
},
183188
{ text: '表單輸入綁定', link: '/guide/essentials/forms' },
184-
{
185-
text: '生命週期',
186-
link: '/guide/essentials/lifecycle'
187-
},
188189
{ text: '偵聽器', link: '/guide/essentials/watchers' },
189190
{ text: '模板引用', link: '/guide/essentials/template-refs' },
190191
{
191192
text: '組件基礎',
192193
link: '/guide/essentials/component-basics'
194+
},
195+
{
196+
text: 'Lifecycle Hooks',
197+
link: '/guide/essentials/lifecycle'
193198
}
194199
]
195200
},
@@ -496,10 +501,6 @@ export const sidebar: ThemeConfig['sidebar'] = {
496501
text: '帶過渡動畫的列表',
497502
link: '/examples/#list-transition'
498503
},
499-
{
500-
text: 'TodoMVC',
501-
link: '/examples/#todomvc'
502-
}
503504
]
504505
},
505506
{
@@ -566,38 +567,19 @@ export const sidebar: ThemeConfig['sidebar'] = {
566567
]
567568
}
568569

569-
const i18n: ThemeConfig['i18n'] = {
570-
search: '搜索',
571-
menu: '菜單',
572-
toc: '本頁目錄',
573-
returnToTop: '返回頂部',
574-
appearance: '外觀',
575-
previous: '前一篇',
576-
next: '下一篇',
577-
pageNotFound: '頁面未找到',
578-
deadLink: {
579-
before: '你打開了一個不存在的鏈接:',
580-
after: '。'
581-
},
582-
deadLinkReport: {
583-
before: '不介意的話請提交到',
584-
link: '這裡',
585-
after: ',我們會跟進修復。'
586-
},
587-
footerLicense: {
588-
before: '',
589-
after: ''
590-
},
591-
ariaAnnouncer: {
592-
before: '',
593-
after: '已經加載完畢'
594-
},
595-
ariaDarkMode: '切換深色模式',
596-
ariaSkipToContent: '直接跳到內容',
597-
ariaToC: '當前頁面的目錄',
598-
ariaMainNav: '主導航',
599-
ariaMobileNav: '移動版導航',
600-
ariaSidebarNav: '側邊欄導航'
570+
// Placeholder of the i18n config for @vuejs-translations.
571+
// const i18n: ThemeConfig['i18n'] = {
572+
// }
573+
574+
function inlineScript(file: string): HeadConfig {
575+
return [
576+
'script',
577+
{},
578+
fs.readFileSync(
579+
path.resolve(__dirname, `./inlined-scripts/${file}`),
580+
'utf-8'
581+
)
582+
]
601583
}
602584

603585
export default defineConfigWithTheme<ThemeConfig>({
@@ -638,25 +620,11 @@ export default defineConfigWithTheme<ThemeConfig>({
638620
'link',
639621
{
640622
rel: 'preconnect',
641-
href: 'https://sponsors.vuejs.org'
623+
href: 'https://automation.vuejs.org'
642624
}
643625
],
644-
[
645-
'script',
646-
{},
647-
fs.readFileSync(
648-
path.resolve(__dirname, './inlined-scripts/restorePreference.js'),
649-
'utf-8'
650-
)
651-
],
652-
[
653-
'script',
654-
{},
655-
fs.readFileSync(
656-
path.resolve(__dirname, './inlined-scripts/uwu.js'),
657-
'utf-8'
658-
)
659-
],
626+
inlineScript('restorePreference.js'),
627+
inlineScript('uwu.js'),
660628
[
661629
'script',
662630
{
@@ -672,7 +640,8 @@ export default defineConfigWithTheme<ThemeConfig>({
672640
src: 'https://vueschool.io/banner.js?affiliate=vuejs&type=top',
673641
async: 'true'
674642
}
675-
]
643+
],
644+
inlineScript('perfops.js')
676645
],
677646

678647
themeConfig: {
@@ -688,7 +657,7 @@ export default defineConfigWithTheme<ThemeConfig>({
688657
},
689658
{
690659
link: 'https://cn.vuejs.org',
691-
text: '简体中文',
660+
text: '簡體中文',
692661
repo: 'https://github.com/vuejs-translations/docs-zh-cn'
693662
},
694663
{
@@ -734,7 +703,7 @@ export default defineConfigWithTheme<ThemeConfig>({
734703
{
735704
link: 'https://ru.vuejs.org',
736705
text: 'Русский',
737-
repo: 'https://github.com/translation-gang/docs-ru'
706+
repo: 'https://github.com/vuejs-translations/docs-ru'
738707
},
739708
{
740709
link: 'https://cs.vuejs.org',
@@ -746,6 +715,11 @@ export default defineConfigWithTheme<ThemeConfig>({
746715
text: '繁體中文',
747716
repo: 'https://github.com/vuejs-translations/docs-zh-hk'
748717
},
718+
{
719+
link: 'https://pl.vuejs.org',
720+
text: 'Polski',
721+
repo: 'https://github.com/vuejs-translations/docs-pl',
722+
},
749723
{
750724
link: '/translations/',
751725
text: '幫助我們翻譯!',
@@ -830,6 +804,7 @@ export default defineConfigWithTheme<ThemeConfig>({
830804
theme: 'github-dark',
831805
config(md) {
832806
md.use(headerPlugin)
807+
.use(groupIconMdPlugin)
833808
// .use(textAdPlugin)
834809
}
835810
},
@@ -858,6 +833,36 @@ export default defineConfigWithTheme<ThemeConfig>({
858833
},
859834
json: {
860835
stringify: true
861-
}
836+
},
837+
plugins: [
838+
llmstxt({
839+
ignoreFiles: [
840+
'about/team/**/*',
841+
'about/team.md',
842+
'about/privacy.md',
843+
'about/coc.md',
844+
'developers/**/*',
845+
'ecosystem/themes.md',
846+
'examples/**/*',
847+
'partners/**/*',
848+
'sponsor/**/*',
849+
'index.md'
850+
],
851+
customLLMsTxtTemplate: `\
852+
# Vue.js
853+
854+
Vue.js - The Progressive JavaScript Framework
855+
856+
## Table of Contents
857+
858+
{toc}`
859+
}) as Plugin,
860+
groupIconVitePlugin({
861+
customIcon: {
862+
cypress: 'vscode-icons:file-type-cypress',
863+
'testing library': 'logos:testing-library'
864+
}
865+
}) as Plugin
866+
]
862867
}
863868
})
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
;((d) => {
2+
window.rum = { key: 'a9efvfeu' }
3+
var script = d.createElement('script')
4+
script.src = '/rom3.min.js'
5+
script.type = 'text/javascript'
6+
script.defer = true
7+
script.async = true
8+
d.getElementsByTagName('head')[0].appendChild(script)
9+
})(document)

.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', true)
99
restore('vue-docs-prefer-sfc', 'prefer-sfc', true)
1010

11-
// window.__VUE_BANNER_ID__ = ''
12-
// restore(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'banner-dismissed')
11+
window.__VUE_BANNER_ID__ = 'viteconf2025'
12+
restore(`vue-docs-banner-${__VUE_BANNER_ID__}`, 'banner-dismissed')
1313
})()

0 commit comments

Comments
 (0)