11import fs from 'fs'
22import path from 'path'
3- import { defineConfigWithTheme , type Plugin } from 'vitepress'
3+ import { defineConfigWithTheme , type HeadConfig , type Plugin } from 'vitepress'
44import type { Config as ThemeConfig } from '@vue/theme'
55import llmstxt from 'vitepress-plugin-llms'
66import baseConfig from '@vue/theme/config'
@@ -497,10 +497,6 @@ export const sidebar: ThemeConfig['sidebar'] = {
497497 text : '带过渡动效的列表' ,
498498 link : '/examples/#list-transition'
499499 } ,
500- {
501- text : 'TodoMVC' ,
502- link : '/examples/#todomvc'
503- }
504500 ]
505501 } ,
506502 {
@@ -601,6 +597,17 @@ const i18n: ThemeConfig['i18n'] = {
601597 ariaSidebarNav : '侧边栏导航'
602598}
603599
600+ function inlineScript ( file : string ) : HeadConfig {
601+ return [
602+ 'script' ,
603+ { } ,
604+ fs . readFileSync (
605+ path . resolve ( __dirname , `./inlined-scripts/${ file } ` ) ,
606+ 'utf-8'
607+ )
608+ ]
609+ }
610+
604611export default defineConfigWithTheme < ThemeConfig > ( {
605612 extends : baseConfig ,
606613
@@ -639,25 +646,11 @@ export default defineConfigWithTheme<ThemeConfig>({
639646 'link' ,
640647 {
641648 rel : 'preconnect' ,
642- href : 'https://sponsors .vuejs.org'
649+ href : 'https://automation .vuejs.org'
643650 }
644651 ] ,
645- [
646- 'script' ,
647- { } ,
648- fs . readFileSync (
649- path . resolve ( __dirname , './inlined-scripts/restorePreference.js' ) ,
650- 'utf-8'
651- )
652- ] ,
653- [
654- 'script' ,
655- { } ,
656- fs . readFileSync (
657- path . resolve ( __dirname , './inlined-scripts/uwu.js' ) ,
658- 'utf-8'
659- )
660- ] ,
652+ inlineScript ( 'restorePreference.js' ) ,
653+ inlineScript ( 'uwu.js' ) ,
661654 [
662655 'script' ,
663656 {
@@ -673,7 +666,8 @@ export default defineConfigWithTheme<ThemeConfig>({
673666 src : 'https://vueschool.io/banner.js?affiliate=vuejs&type=top' ,
674667 async : 'true'
675668 }
676- ]
669+ ] ,
670+ inlineScript ( 'perfops.js' )
677671 ] ,
678672
679673 themeConfig : {
@@ -730,7 +724,7 @@ export default defineConfigWithTheme<ThemeConfig>({
730724 {
731725 link : 'https://ru.vuejs.org' ,
732726 text : 'Русский' ,
733- repo : 'https://github.com/translation-gang /docs-ru'
727+ repo : 'https://github.com/vuejs-translations /docs-ru'
734728 } ,
735729 {
736730 link : 'https://cs.vuejs.org' ,
@@ -742,6 +736,11 @@ export default defineConfigWithTheme<ThemeConfig>({
742736 text : '繁體中文' ,
743737 repo : 'https://github.com/vuejs-translations/docs-zh-hk'
744738 } ,
739+ {
740+ link : 'https://pl.vuejs.org' ,
741+ text : 'Polski' ,
742+ repo : 'https://github.com/vuejs-translations/docs-pl' ,
743+ } ,
745744 {
746745 link : '/translations/' ,
747746 text : '帮助我们翻译!' ,
0 commit comments