1+ import { defineConfig } from 'vitepress'
2+ import { tabsMarkdownPlugin } from 'vitepress-plugin-tabs'
3+ import mathjax3 from "markdown-it-mathjax3" ;
4+
5+ function getBaseRepository ( base : string ) : string {
6+ if ( ! base || base === '/' ) return '/' ;
7+ const parts = base . split ( '/' ) . filter ( Boolean ) ;
8+ return parts . length > 0 ? `/${ parts [ 0 ] } /` : '/' ;
9+ }
10+
11+ const baseTemp = {
12+ base : '/YAXArrays.jl/previews/PR503/' ,
13+ }
14+
15+ const navTemp = {
16+ nav : [
17+ { text : 'Home' , link : '/' } ,
18+ { text : 'Get Started' , link : '/get_started' } ,
19+ {
20+ text : 'User Guide' ,
21+ items : [
22+ { text : 'Types' , link : '/UserGuide/types' } ,
23+ { text : 'Read' , link : '/UserGuide/read' } ,
24+ { text : 'Write' , link : '/UserGuide/write' } ,
25+ { text : 'Convert' , link : '/UserGuide/convert' } ,
26+ { text : 'Create' , link : '/UserGuide/create' } ,
27+ { text : 'Select' , link : '/UserGuide/select' } ,
28+ { text : 'Compute' , link : '/UserGuide/compute' } ,
29+ { text : 'Chunk' , link : '/UserGuide/chunk' } ,
30+ { text : 'Cache' , link : '/UserGuide/cache' } ,
31+ { text : 'Group' , link : '/UserGuide/group' } ,
32+ { text : 'Combine' , link : '/UserGuide/combine' } ,
33+ { text : 'FAQ' , link : '/UserGuide/faq' }
34+ ]
35+ } ,
36+ {
37+ text : 'Tutorials' ,
38+ items : [
39+ { text : 'Plotting maps' , link : '/tutorials/plottingmaps' } ,
40+ { text : 'Mean Seasonal Cycle' , link : '/tutorials/mean_seasonal_cycle' } ,
41+ {
42+ text : 'ESDL studies' ,
43+ items : [
44+ { text : 'ESDL study 1' , link : 'https://github.com/JuliaDataCubes/YAXArrays.jl/blob/master/docs/src/tutorials/esdl/examples_from_esdl_study_1.jl' } ,
45+ { text : 'ESDL study 2' , link : 'https://github.com/JuliaDataCubes/YAXArrays.jl/blob/master/docs/src/tutorials/esdl/examples_from_esdl_study_2.jl' } ,
46+ { text : 'ESDL study 3' , link : 'https://github.com/JuliaDataCubes/YAXArrays.jl/blob/master/docs/src/tutorials/esdl/examples_from_esdl_study_3.jl' } ,
47+ { text : 'ESDL study 4' , link : 'https://github.com/JuliaDataCubes/YAXArrays.jl/blob/master/docs/src/tutorials/esdl/examples_from_esdl_study_4.jl' } ,
48+ ]
49+ } ,
50+ { text : 'Other Tutorials' , link : '/tutorials/other_tutorials' } ,
51+ ]
52+ } ,
53+ { text : 'Ecosystem' ,
54+ items : [
55+ { text : 'DimensionalData.jl' , link : 'https://rafaqz.github.io/DimensionalData.jl/dev/' } ,
56+ { text : 'NetCDF.jl' , link : 'https://juliageo.org/NetCDF.jl/stable/' } ,
57+ { text : 'Zarr.jl' , link : 'https://juliaio.github.io/Zarr.jl/latest/' } ,
58+ { text : 'ArchGDAL.jl' , link : 'https://yeesian.com/ArchGDAL.jl/stable/' } ,
59+ { text : 'GeoMakie.jl' , link : 'https://geo.makie.org/dev/' } ,
60+ { text : 'Makie.jl' , link : 'https://docs.makie.org/dev/' } ,
61+ ]
62+ } ,
63+ {
64+ text : 'Development' ,
65+ items : [
66+ { text : 'Contribute' , link : 'development/contribute' } ,
67+ { text : 'Contributors' , link : 'development/contributors' }
68+ ]
69+ } ,
70+ ] ,
71+ }
72+
73+ const nav = [
74+ ...navTemp . nav ,
75+ {
76+ component : 'VersionPicker'
77+ }
78+ ]
79+ // https://vitepress.dev/reference/site-config
80+ export default defineConfig ( {
81+ base : '/YAXArrays.jl/previews/PR503/' ,
82+ title : "YAXArrays.jl" ,
83+ description : "Yet another xarray-like Julia package" ,
84+ lastUpdated : true ,
85+ // cleanUrls: true,
86+ outDir : '../1' , // This is required for MarkdownVitepress to work correctly...
87+ head : [
88+ [ 'link' , { rel : 'icon' , href : '/favicon.ico' } ] ,
89+ [ 'script' , { src : `${ getBaseRepository ( baseTemp . base ) } versions.js` } ] ,
90+ [ 'script' , { src : `${ baseTemp . base } siteinfo.js` } ]
91+ ] ,
92+ // ignoreDeadLinks: true,
93+ vite : {
94+ build : {
95+ assetsInlineLimit : 0 , // so we can tell whether we have created inlined images or not, we don't let vite inline them
96+ } ,
97+ optimizeDeps : {
98+ exclude : [
99+ '@nolebase/vitepress-plugin-enhanced-readabilities/client' ,
100+ 'vitepress' ,
101+ '@nolebase/ui' ,
102+ ] ,
103+ } ,
104+ ssr : {
105+ noExternal : [
106+ // If there are other packages that need to be processed by Vite, you can add them here.
107+ '@nolebase/vitepress-plugin-enhanced-readabilities' ,
108+ '@nolebase/ui' ,
109+ ] ,
110+ } ,
111+ } ,
112+ markdown : {
113+ math : true ,
114+ config ( md ) {
115+ md . use ( tabsMarkdownPlugin ) ,
116+ md . use ( mathjax3 )
117+ } ,
118+ theme : {
119+ light : "github-light" ,
120+ dark : "github-dark"
121+ }
122+ } ,
123+ themeConfig : {
124+ outline : 'deep' ,
125+ // https://vitepress.dev/reference/default-theme-config
126+ logo : { src : '/logo.png' , width : 24 , height : 24 } ,
127+ search : {
128+ provider : 'local' ,
129+ options : {
130+ detailedView : true
131+ }
132+ } ,
133+ nav,
134+ sidebar : [
135+ { text : 'Get Started' , link : '/get_started' } ,
136+ { text : 'API Reference' , link : '/api' } ,
137+ {
138+ text : 'User Guide' ,
139+ items : [
140+ { text : 'Types' , link : '/UserGuide/types' } ,
141+ { text : 'Read' , link : '/UserGuide/read' } ,
142+ { text : 'Write' , link : '/UserGuide/write' } ,
143+ { text : 'Convert' , link : '/UserGuide/convert' } ,
144+ { text : 'Create' , link : '/UserGuide/create' } ,
145+ { text : 'Select' , link : '/UserGuide/select' } ,
146+ { text : 'Compute' , link : '/UserGuide/compute' } ,
147+ { text : 'Chunk' , link : '/UserGuide/chunk' } ,
148+ { text : 'Cache' , link : '/UserGuide/cache' } ,
149+ { text : 'Group' , link : '/UserGuide/group' } ,
150+ { text : 'Combine' , link : '/UserGuide/combine' } ,
151+ { text : 'FAQ' , link : '/UserGuide/faq' }
152+ ]
153+ } ,
154+ {
155+ text : 'Tutorials' ,
156+ items : [
157+ { text : 'Plotting maps' , link : '/tutorials/plottingmaps' } ,
158+ { text : 'Mean Seasonal Cycle' , link : '/tutorials/mean_seasonal_cycle' } ,
159+ { text : 'Other Tutorials' , link : '/tutorials/other_tutorials' } ,
160+ ]
161+ } ,
162+ {
163+ text : 'Development' ,
164+ items : [
165+ { text : 'Contribute' , link : 'development/contribute' } ,
166+ { text : 'Contributors' , link : 'development/contributors' }
167+ ]
168+ } ,
169+ ] ,
170+ editLink : {
171+ pattern : 'https://github.com/JuliaDataCubes/YAXArrays.jl/edit/master/docs/src/:path'
172+ } ,
173+ socialLinks : [
174+ // { icon: 'github', link: 'https://github.com/JuliaDataCubes/YAXArrays.jl' }
175+ ] ,
176+ footer : {
177+ message : 'Made with <a href="https://github.com/LuxDL/DocumenterVitepress.jl" target="_blank"><strong>DocumenterVitepress.jl</strong></a>' ,
178+ copyright : `© Copyright ${ new Date ( ) . getUTCFullYear ( ) } . Released under the MIT License.`
179+ }
180+ }
181+ } )
0 commit comments