1
1
import fs from 'fs'
2
2
import path from 'path'
3
- import { defineConfigWithTheme } from 'vitepress'
3
+ import { defineConfigWithTheme , type HeadConfig , type Plugin } from 'vitepress'
4
4
import type { Config as ThemeConfig } from '@vue/theme'
5
+ import llmstxt from 'vitepress-plugin-llms'
5
6
import baseConfig from '@vue/theme/config'
6
7
import { headerPlugin } from './headerMdPlugin'
7
8
// import { textAdPlugin } from './textAdMdPlugin'
@@ -570,6 +571,17 @@ export const sidebar: ThemeConfig['sidebar'] = {
570
571
// const i18n: ThemeConfig['i18n'] = {
571
572
// }
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
+ ]
583
+ }
584
+
573
585
export default defineConfigWithTheme < ThemeConfig > ( {
574
586
extends : baseConfig ,
575
587
@@ -608,25 +620,11 @@ export default defineConfigWithTheme<ThemeConfig>({
608
620
'link' ,
609
621
{
610
622
rel : 'preconnect' ,
611
- href : 'https://sponsors .vuejs.org'
623
+ href : 'https://automation .vuejs.org'
612
624
}
613
625
] ,
614
- [
615
- 'script' ,
616
- { } ,
617
- fs . readFileSync (
618
- path . resolve ( __dirname , './inlined-scripts/restorePreference.js' ) ,
619
- 'utf-8'
620
- )
621
- ] ,
622
- [
623
- 'script' ,
624
- { } ,
625
- fs . readFileSync (
626
- path . resolve ( __dirname , './inlined-scripts/uwu.js' ) ,
627
- 'utf-8'
628
- )
629
- ] ,
626
+ inlineScript ( 'restorePreference.js' ) ,
627
+ inlineScript ( 'uwu.js' ) ,
630
628
[
631
629
'script' ,
632
630
{
@@ -642,7 +640,8 @@ export default defineConfigWithTheme<ThemeConfig>({
642
640
src : 'https://vueschool.io/banner.js?affiliate=vuejs&type=top' ,
643
641
async : 'true'
644
642
}
645
- ]
643
+ ] ,
644
+ inlineScript ( 'perfops.js' )
646
645
] ,
647
646
648
647
themeConfig : {
@@ -700,7 +699,7 @@ export default defineConfigWithTheme<ThemeConfig>({
700
699
{
701
700
link : 'https://ru.vuejs.org' ,
702
701
text : 'Русский' ,
703
- repo : 'https://github.com/translation-gang /docs-ru'
702
+ repo : 'https://github.com/vuejs-translations /docs-ru'
704
703
} ,
705
704
{
706
705
link : 'https://cs.vuejs.org' ,
@@ -712,6 +711,11 @@ export default defineConfigWithTheme<ThemeConfig>({
712
711
text : '繁體中文' ,
713
712
repo : 'https://github.com/vuejs-translations/docs-zh-hk'
714
713
} ,
714
+ {
715
+ link : 'https://pl.vuejs.org' ,
716
+ text : 'Polski' ,
717
+ repo : 'https://github.com/vuejs-translations/docs-pl' ,
718
+ } ,
715
719
{
716
720
link : '/translations/' ,
717
721
text : 'Help Us Translate!' ,
@@ -785,6 +789,30 @@ export default defineConfigWithTheme<ThemeConfig>({
785
789
} ,
786
790
json : {
787
791
stringify : true
788
- }
792
+ } ,
793
+ plugins : [
794
+ llmstxt ( {
795
+ ignoreFiles : [
796
+ 'about/team/**/*' ,
797
+ 'about/team.md' ,
798
+ 'about/privacy.md' ,
799
+ 'about/coc.md' ,
800
+ 'developers/**/*' ,
801
+ 'ecosystem/themes.md' ,
802
+ 'examples/**/*' ,
803
+ 'partners/**/*' ,
804
+ 'sponsor/**/*' ,
805
+ 'index.md'
806
+ ] ,
807
+ customLLMsTxtTemplate : `\
808
+ # Vue.js
809
+
810
+ Vue.js - The Progressive JavaScript Framework
811
+
812
+ ## Table of Contents
813
+
814
+ {toc}`
815
+ } ) as Plugin
816
+ ]
789
817
}
790
818
} )
0 commit comments