@@ -4,17 +4,17 @@ import { fileURLToPath } from 'node:url'
44import { ReflectionKind } from 'typedoc'
55import type { DefaultTheme } from 'vitepress'
66import { defineConfig } from 'vitepress'
7- import apiJSON from '../../api/api.json'
7+ import apiJSON from '../../api/echarts-layer/ api.json'
88import { pascalToKebab , singularToPlural } from './util'
99
1010// https://vitepress.dev/reference/site-config
1111export default defineConfig ( {
1212 lang : 'zh-Hans-CN' ,
13- title : 'Lib ' ,
13+ title : 'maplibre-gl-layers ' ,
1414 // titleTemplate: 'Lib',
15- description : 'A JavaScript library template built with Vite ' ,
16- base : '/vite-lib-template /' ,
17- head : [ [ 'link' , { rel : 'icon' , href : '/vite-lib-template /logo.svg' } ] ] ,
15+ description : '自定义图层集 ' ,
16+ base : '/maplibre-gl-layers /' ,
17+ head : [ [ 'link' , { rel : 'icon' , href : '/maplibre-gl-layers /logo.svg' } ] ] ,
1818 cleanUrls : true ,
1919 rewrites : {
2020 '(.*)/README.md' : '(.*)/index.md'
@@ -35,11 +35,23 @@ export default defineConfig({
3535 } ,
3636 nav : [
3737 { text : '快速开始' , link : '/starter' } ,
38- { text : '示例 ' , link : '/examples ' } ,
39- { text : 'API ' , link : '/api ' }
38+ { text : 'API ' , link : '/api ' } ,
39+ { text : '示例 ' , link : '/examples ' }
4040 ] ,
4141 sidebar : {
42- '/api' : sidebarApi ( ) ,
42+ // '/api': sidebarApi(),
43+ api : [
44+ {
45+ text : 'echarts-layer' ,
46+ link : '/api/echarts-layer' ,
47+ items : sidebarApi ( 'echarts-layer' )
48+ } ,
49+ {
50+ text : 'image-layer' ,
51+ link : '/api/image-layer' ,
52+ items : sidebarApi ( 'image-layer' )
53+ }
54+ ] ,
4355 '/examples' : [
4456 {
4557 text : '示例' ,
@@ -51,11 +63,11 @@ export default defineConfig({
5163 socialLinks : [
5264 {
5365 icon : 'github' ,
54- link : 'https://github.com/huanglii/vite-lib-template '
66+ link : 'https://github.com/naivemap/maplibre-gl-layers '
5567 }
5668 ] ,
5769 editLink : {
58- pattern : 'https://github.com/huanglii/vite-lib-template /edit/main/docs/:path' ,
70+ pattern : 'https://github.com/naivemap/maplibre-gl-layers /edit/main/docs/:path' ,
5971 text : '在 GitHub 上编辑此页面'
6072 } ,
6173 footer : {
@@ -118,7 +130,7 @@ export default defineConfig({
118130/**
119131 * 生成 API 侧边栏
120132 */
121- function sidebarApi ( ) : DefaultTheme . SidebarItem [ ] {
133+ function sidebarApi ( pkg : string ) : DefaultTheme . SidebarItem [ ] {
122134 /**
123135 * 按类型分组 Kinds of reflection:
124136 * URL_ADDRESS * https://typedoc.org/api/enums/Models.ReflectionKind.html
@@ -133,7 +145,7 @@ function sidebarApi(): DefaultTheme.SidebarItem[] {
133145 res . push ( {
134146 text : key ,
135147 items : value . map ( ( item ) => {
136- return { text : item . name , link : `/api/${ path } /${ item . name } ` }
148+ return { text : item . name , link : `/api/${ pkg } / ${ path } /${ item . name } ` }
137149 } )
138150 } )
139151 }
0 commit comments