// .vuepress/config.js
const path = require('path');
const autometa_options = {
    site: {
        name: 'Spring 中文文档社区'
    },
    canonical_base: 'https://dev-cloud.gitcode.host/spring/',
};

module.exports = {
    title: "Spring 中文文档社区",
    base: "/spring/",
    head: [
        [
            'link',
            {
                rel: 'icon',
                type: 'image/png',
                sizes: '16x16',
                href: `/images/icons/favicon.ico`,
            },
        ],
        [
            'link',
            {
                rel: 'icon',
                type: 'image/png',
                sizes: '48x48',
                href: `/images/icons/icon-48x48.png`,
            },
        ],
        [
            'link',
            {
                rel: 'icon',
                type: 'image/png',
                sizes: '72x72',
                href: `/images/icons/icon-72x72.png`,
            },
        ],
        ['link', { rel: 'manifest', href: '/manifest.webmanifest' }],
        ['meta', { name: 'application-name', content: 'Spring 中文文档社区' }],
        ['meta', { name: 'apple-mobile-web-app-title', content: 'Spring 中文社区' }],
        [
            'meta',
            { name: 'apple-mobile-web-app-status-bar-style', content: 'black' },
        ],
        [
            'link',
            { rel: 'apple-touch-icon', href: `/images/icons/icon_48x48.png` },
        ],
        [
            'link',
            {
                rel: 'mask-icon',
                href: '/images/icons/favicon.ico',
                color: '#5dac38',
            },
        ],
        ['meta', { name: 'msapplication-TileColor', content: '#5dac38' }],
        ['meta', { name: 'theme-color', content: '#5dac38' }],
        ['meta', { name: 'viewport', content: 'width=device-width, initial-scale=1' }],
        ['meta', { 'http-equiv': 'X-UA-Compatible', 'content': 'IE=edge' }]
    ],
    locales: {
        // '/en/': {
        //     lang: 'en-US',
        //     title: 'Spring Docs',
        //     description: ''
        // },
        '/': {
            lang: 'zh-CN',
            title: '中文文档',
            description: ''
        }
    },
    plugins: [
        ['autometa', autometa_options]
    ],
    theme: path.resolve(__dirname,'./themes/theme-gitcode/index.js'),
    themeConfig: {
        repo: "https://gitcode.net/dev-cloud/spring",
        repoLabel: "GitCode",
        docsRepo: "https://gitcode.net/dev-cloud/spring/",
        docsDir: 'docs',
        docsBranch: 'master',
        editLinks: true,
        editLinkText: "帮助我们改善此页面！",
        lastUpdated: "Last Updated",
        logo: '/images/icons/spring-logo.svg',
        sidebarDepth: 3,
        activeHeaderLinks: true,
        locales: {
            // '/en/': {
            //     // 多语言下拉菜单的标题
            //     selectText: 'Language',
            //     // 该语言在下拉菜单中的标签
            //     label: 'English',
            //     lastUpdated: 'Last Updated',
            //     lang: 'en-US',
            //     // 编辑链接文字
            //     editLinkText: 'Edit this page on GitCode',
            //     algolia: {},
            //     nav: [
            //         {
            //             text: 'Spring',
            //             link: '/en/'
            //         },
            //         {
            //             text: 'Spring Boot',
            //             link: '/en/spring-boot/'
            //         },
            //         {
            //             text: 'Spring Framework',
            //             link: '/en/spring-framework/'
            //         },
            //         {
            //             text: 'Spring Data',
            //             link: '/en/spring-data/'
            //         },
            //         {
            //             text: 'Spring Cloud',
            //             link: '/en/spring-cloud/'
            //         },
            //         {
            //             text: 'More',
            //             ariaLabel: 'Others',
            //             items: [
            //                 { text: 'Spring Cloud Data Flow', link: '/en/spring-cloud-data-flow/'},
            //                 { text: 'Spring Security', link: '/en/spring-security/'},
            //                 { text: 'Spring for GraphQL', link: '/en/spring-for-graphql/'},
            //                 { text: 'Spring Session', link: '/en/spring-session/'},
            //                 { text: 'Spring Integration', link: '/en/spring-integration/'},
            //                 { text: 'Spring HATEOAS', link: '/en/spring-hateoas/'},
            //                 { text: 'Spring REST Docs', link: '/en/spring-rest-docs/'},
            //                 { text: 'Spring Batch', link: '/en/spring-batch/'},
            //                 { text: 'Spring AMQP', link: '/en/spring-amqp/'},
            //                 { text: 'Spring CredHub', link: '/en/spring-credhub/'},
            //                 { text: 'Spring Flo', link: '/en/spring-flo/'},
            //                 { text: 'Spring for Apache Kafka', link: '/en/spring-for-apache-kafka/'},
            //                 { text: 'Spring LDAP', link: '/en/spring-ldap/'},
            //                 { text: 'Spring Shell', link: '/en/spring-shell/'},
            //                 { text: 'Spring Statemachine', link: '/en/spring-statemachine/'},
            //                 { text: 'Spring Vault', link: '/en/spring-vault/'},
            //                 { text: 'Spring Web Flow', link: '/en/spring-web-flow/'},
            //                 { text: 'Spring Web Services', link: '/en/spring-web-services/'}
            //             ]
            //         }
            //         ],
            //     sidebar: {
            //         '/en/spring-boot/': [
            //             {
            //                 title: 'Spring Boot',
            //                 sidebarDepth: 2,
            //                 collapsable: false,
            //                 children: [
            //                     "/en/spring-boot/legal.md",
            //                     "/en/spring-boot/getting-help.md",
            //                     "/en/spring-boot/documentation.md",
            //                     "/en/spring-boot/getting-started.md",
            //                     "/en/spring-boot/upgrading.md",
            //                     "/en/spring-boot/using.md",
            //                     "/en/spring-boot/features.md",
            //                     "/en/spring-boot/web.md",
            //                     "/en/spring-boot/data.md",
            //                     "/en/spring-boot/io.md",
            //                     "/en/spring-boot/messaging.md",
            //                     "/en/spring-boot/container-images.md",
            //                     "/en/spring-boot/actuator.md",
            //                     "/en/spring-boot/deployment.md",
            //                     "/en/spring-boot/cli.md",
            //                     "/en/spring-boot/build-tool-plugins.md",
            //                     "/en/spring-boot/howto.md"
            //                 ],
            //                 initialOpenGroupIndex: 0 // 可选的, 默认值是 0
            //             }
            //         ],
            //         '/en/spring-framework/': [
            //             {
            //                 title: 'Spring Framework',
            //                 sidebarDepth: 2,
            //                 collapsable: false,
            //                 children: [
            //                     "/en/spring-framework/overview.md",
            //                     "/en/spring-framework/core.md",
            //                     "/en/spring-framework/testing.md",
            //                     "/en/spring-framework/data-access.md",
            //                     "/en/spring-framework/web-servlet.md",
            //                     "/en/spring-framework/web-reactive.md",
            //                     "/en/spring-framework/integration.md",
            //                     "/en/spring-framework/languages.md"
            //                 ],
            //                 initialOpenGroupIndex: 0 // 可选的, 默认值是 0
            //             }
            //         ],
            //         '/en/spring-data/': [
            //             {
            //                 title: 'Spring Data',
            //                 sidebarDepth: 2,
            //                 collapsable: false,
            //                 children: [
            //                     "/en/spring-data/spring-data.md"
            //                 ],
            //                 initialOpenGroupIndex: 0 // 可选的, 默认值是 0
            //             }
            //         ],
            //         '/en/spring-cloud/': [
            //             {
            //                 title: 'Spring Cloud',
            //                 sidebarDepth: 2,
            //                 collapsable: false,
            //                 children: [
            //                     "/en/spring-cloud/legal.md",
            //                     "/en/spring-cloud/documentation-overview.md",
            //                     "/en/spring-cloud/spring-cloud-build.md",
            //                     "/en/spring-cloud/spring-cloud-bus.md",
            //                     "/en/spring-cloud/spring-cloud-circuitbreaker.md",
            //                     "/en/spring-cloud/spring-cloud-cli.md",
            //                     "/en/spring-cloud/spring-cloud-cloudfoundry.md",
            //                     "/en/spring-cloud/spring-cloud-commons.md",
            //                     "/en/spring-cloud/spring-cloud-config.md",
            //                     "/en/spring-cloud/spring-cloud-consul.md",
            //                     "/en/spring-cloud/spring-cloud-contract.md",
            //                     "/en/spring-cloud/spring-cloud-function.md",
            //                     "/en/spring-cloud/spring-cloud-gateway.md",
            //                     "/en/spring-cloud/spring-cloud-kubernetes.md",
            //                     "/en/spring-cloud/spring-cloud-netflix.md",
            //                     "/en/spring-cloud/spring-cloud-openfeign.md",
            //                     "/en/spring-cloud/spring-cloud-sleuth.md",
            //                     "/en/spring-cloud/spring-cloud-stream.md",
            //                     "/en/spring-cloud/spring-cloud-task.md",
            //                     "/en/spring-cloud/spring-cloud-vault.md",
            //                     "/en/spring-cloud/spring-cloud-zookeeper.md",
            //                 ],
            //                 initialOpenGroupIndex: 0 // 可选的, 默认值是 0
            //             }
            //         ],
            //         '/en/spring-cloud-data-flow/': [
            //             {
            //                 title: 'Spring Cloud Data Flow',
            //                 sidebarDepth: 2,
            //                 collapsable: false,
            //                 children: [
            //                     "/en/spring-cloud-data-flow/spring-cloud-dataflow.md",
            //                 ],
            //                 initialOpenGroupIndex: 0 // 可选的, 默认值是 0
            //             }
            //         ],
            //         '/en/spring-security/': [
            //             {
            //                 title: 'Spring Security',
            //                 sidebarDepth: 2,
            //                 collapsable: false,
            //                 children: [
            //                     "/en/spring-security/index.md",
            //                     "/en/spring-security/prerequisites.md",
            //                     "/en/spring-security/community.md",
            //                     "/en/spring-security/whats-new.md",
            //                     "/en/spring-security/getting-spring-security.md",
            //                     "/en/spring-security/features.md",
            //                     "/en/spring-security/modules.md",
            //                     "/en/spring-security/samples.md",
            //                     "/en/spring-security/servlet.md",
            //                     "/en/spring-security/reactive.md"
            //                 ],
            //                 initialOpenGroupIndex: 0 // 可选的, 默认值是 0
            //             }
            //         ],
                    
            //         // fallback
            //         '/en/': 
            //             [{
            //                 title: 'Spring Doc', // 必要的
            //                 // path: '/', // 可选的, 标题的跳转链接，应为绝对路径且必须存在
            //                 collapsable: false, // 可选的, 默认值是 true,
            //                 sidebarDepth: 1, // 可选的, 默认值是 1
            //                 children: [
            //                     ''
            //                 ]
            //             },
            //             {
            //                 title: 'INTRO',
            //                 sidebarDepth: 2,
            //                 collapsable: false,
            //                 children: [
            //                     "/en/why-spring.md",
            //                     "/en/introducing-spring-boot.md",
            //                     "/en/quickstart.md"
            //                 ],
            //                 initialOpenGroupIndex: 0 // 可选的, 默认值是 0
            //             },
            //             {
            //                 title: 'GUIDE',
            //                 sidebarDepth: 2,
            //                 collapsable: false,
            //                 children: [
            //                     "/en/system-requirements.md",
            //                     "/en/installing.md",
            //                     "/en/initializr.md"
            //                 ],
            //                 initialOpenGroupIndex: 0 // 可选的, 默认值是 0
            //             },
            //             {
            //                 title: 'IDE',
            //                 sidebarDepth: 2,
            //                 collapsable: false,
            //                 children: [
            //                     "/en/vscode_java.md",
            //                     "/en/intellij_idea.md"
            //                 ],
            //                 initialOpenGroupIndex: 0 // 可选的, 默认值是 0
            //             },
            //             {
            //                 title: 'DEMO',
            //                 sidebarDepth: 2,
            //                 collapsable: false,
            //                 children: [
            //                     "/en/getting-started_first-application.md",
            //                     "/en/rest-service.md",
            //                     "/en/consuming-rest.md"
            //                 ],
            //                 initialOpenGroupIndex: 0 // 可选的, 默认值是 0
            //             }
            //         ]
            //     }
            // },
            '/': {
                selectText: '选择语言',
                label: '简体中文',
                ariaLabel: '语言',
                lang: 'zh-CN',
                editLinkText: '在 GitCode 上编辑此页',
                lastUpdated: '上次更新',
                algolia: {},
                nav: [
                    {
                        text: 'Spring',
                        link: '/'
                    },
                    {
                        text: 'Spring Boot',
                        link: '/spring-boot/'
                    },
                    {
                        text: 'Spring Framework',
                        link: '/spring-framework/'
                    },
                    {
                        text: 'Spring Data',
                        link: '/spring-data/'
                    },
                    {
                        text: 'Spring Cloud',
                        link: '/spring-cloud/'
                    },
                    {
                        text: '更多文档',
                        ariaLabel: 'Others',
                        items: [
                            { text: 'Spring Cloud Data Flow', link: '/spring-cloud-data-flow/'},
                            { text: 'Spring Security', link: '/spring-security/'},
                            { text: 'Spring for GraphQL', link: '/spring-for-graphql/'},
                            { text: 'Spring Session', link: '/spring-session/'},
                            { text: 'Spring Integration', link: '/spring-integration/'},
                            { text: 'Spring HATEOAS', link: '/spring-hateoas/'},
                            { text: 'Spring REST Docs', link: '/spring-rest-docs/'},
                            { text: 'Spring Batch', link: '/spring-batch/'},
                            { text: 'Spring AMQP', link: '/spring-amqp/'},
                            { text: 'Spring CredHub', link: '/spring-credhub/'},
                            { text: 'Spring Flo', link: '/spring-flo/'},
                            { text: 'Spring for Apache Kafka', link: '/spring-for-apache-kafka/'},
                            { text: 'Spring LDAP', link: '/spring-ldap/'},
                            { text: 'Spring Shell', link: '/spring-shell/'},
                            { text: 'Spring Statemachine', link: '/spring-statemachine/'},
                            { text: 'Spring Vault', link: '/spring-vault/'},
                            { text: 'Spring Web Flow', link: '/spring-web-flow/'},
                            { text: 'Spring Web Services', link: '/spring-web-services/'}
                        ]
                    }
                    ],
                sidebar: {
                    
                    '/spring-boot/': [
                        {
                            title: 'Spring Boot 文档',
                            sidebarDepth: 2,
                            collapsable: false,
                            children: [
                                "/spring-boot/legal.md",
                                "/spring-boot/getting-help.md",
                                "/spring-boot/documentation.md",
                                "/spring-boot/getting-started.md",
                                "/spring-boot/upgrading.md",
                                "/spring-boot/using.md",
                                "/spring-boot/features.md",
                                "/spring-boot/web.md",
                                "/spring-boot/data.md",
                                "/spring-boot/io.md",
                                "/spring-boot/messaging.md",
                                "/spring-boot/container-images.md",
                                "/spring-boot/actuator.md",
                                "/spring-boot/deployment.md",
                                "/spring-boot/cli.md",
                                "/spring-boot/build-tool-plugins.md",
                                "/spring-boot/howto.md"
                            ],
                            initialOpenGroupIndex: 0 // 可选的, 默认值是 0
                        }
                    ],
                    '/spring-framework/': [
                        {
                            title: 'Spring Framework 文档',
                            sidebarDepth: 2,
                            collapsable: false,
                            children: [
                                "/spring-framework/overview.md",
                                "/spring-framework/core.md",
                                "/spring-framework/testing.md",
                                "/spring-framework/data-access.md",
                                "/spring-framework/web-servlet.md",
                                "/spring-framework/web-reactive.md",
                                "/spring-framework/integration.md",
                                "/spring-framework/languages.md"
                            ],
                            initialOpenGroupIndex: 0 // 可选的, 默认值是 0
                        }
                    ],
                    '/spring-data/': [
                        {
                            title: 'Spring Data 文档',
                            sidebarDepth: 2,
                            collapsable: false,
                            children: [
                                "/spring-data/spring-data.md"
                            ],
                            initialOpenGroupIndex: 0 // 可选的, 默认值是 0
                        }
                    ],
                    '/spring-cloud/': [
                        {
                            title: 'Spring Cloud 文档',
                            sidebarDepth: 2,
                            collapsable: false,
                            children: [
                                "/spring-cloud/legal.md",
                                "/spring-cloud/documentation-overview.md",
                                "/spring-cloud/spring-cloud-build.md",
                                "/spring-cloud/spring-cloud-bus.md",
                                "/spring-cloud/spring-cloud-circuitbreaker.md",
                                "/spring-cloud/spring-cloud-cli.md",
                                "/spring-cloud/spring-cloud-cloudfoundry.md",
                                "/spring-cloud/spring-cloud-commons.md",
                                "/spring-cloud/spring-cloud-config.md",
                                "/spring-cloud/spring-cloud-consul.md",
                                "/spring-cloud/spring-cloud-contract.md",
                                "/spring-cloud/spring-cloud-function.md",
                                "/spring-cloud/spring-cloud-gateway.md",
                                "/spring-cloud/spring-cloud-kubernetes.md",
                                "/spring-cloud/spring-cloud-netflix.md",
                                "/spring-cloud/spring-cloud-openfeign.md",
                                "/spring-cloud/spring-cloud-sleuth.md",
                                "/spring-cloud/spring-cloud-stream.md",
                                "/spring-cloud/spring-cloud-task.md",
                                "/spring-cloud/spring-cloud-vault.md",
                                "/spring-cloud/spring-cloud-zookeeper.md"
                            ],
                            initialOpenGroupIndex: 0 // 可选的, 默认值是 0
                        }
                    ],
                    '/spring-cloud-data-flow/': [
                        {
                            title: 'Spring Cloud Data Flow',
                            sidebarDepth: 2,
                            collapsable: false,
                            children: [
                                "/spring-cloud-data-flow/spring-cloud-dataflow.md",
                            ],
                            initialOpenGroupIndex: 0 // 可选的, 默认值是 0
                        }
                    ],
                    // '/spring-security/': [
                    //     {
                    //         title: 'Spring 安全',
                    //         sidebarDepth: 2,
                    //         collapsable: false,
                    //         children: [
                    //             "/spring-security/overview.md",
                    //             "/spring-security/prerequisites.md",
                    //             "/spring-security/community.md",
                    //             "/spring-security/whats-new.md",
                    //             "/spring-security/getting-spring-security.md",
                    //             "/spring-security/features.md",
                    //             "/spring-security/modules.md",
                    //             "/spring-security/samples.md",
                    //             "/spring-security/servlet.md",
                    //             "/spring-security/reactive.md"
                    //         ],
                    //         initialOpenGroupIndex: 0 // 可选的, 默认值是 0
                    //     }
                    // ],

                    '/spring-for-graphql/': [
                        {
                            title: 'Spring For Graphql',
                            sidebarDepth: 2,
                            collapsable: false,
                            children: [
                                "/spring-for-graphql/spring-graphql.md",
                            ],
                            initialOpenGroupIndex: 0 // 可选的, 默认值是 0
                        }
                    ],
                    '/spring-hateoas/': [
                        {
                            title: 'Spring HATEOAS',
                            sidebarDepth: 2,
                            collapsable: false,
                            children: [
                                "/spring-hateoas/spring-hateoas.md",
                            ],
                            initialOpenGroupIndex: 0 // 可选的, 默认值是 0
                        }
                    ],
                    '/spring-rest-docs/': [
                        {
                            title: 'Spring HATEOAS',
                            sidebarDepth: 2,
                            collapsable: false,
                            children: [
                                "/spring-rest-docs/spring-restdocs.md",
                            ],
                            initialOpenGroupIndex: 0 // 可选的, 默认值是 0
                        }
                    ],
                    '/spring-amqp/': [
                        {
                            title: 'Spring AMQP',
                            sidebarDepth: 2,
                            collapsable: false,
                            children: [
                                "/spring-amqp/spring-amqp.md",
                            ],
                            initialOpenGroupIndex: 0 // 可选的, 默认值是 0
                        }
                    ],
                    '/spring-credhub/': [
                        {
                            title: 'Spring CredHub',
                            sidebarDepth: 2,
                            collapsable: false,
                            children: [
                                "/spring-credhub/spring-credhub.md",
                            ],
                            initialOpenGroupIndex: 0 // 可选的, 默认值是 0
                        }
                    ],
                    '/spring-flo/': [
                        {
                            title: 'Spring Flo',
                            sidebarDepth: 2,
                            collapsable: false,
                            children: [
                                "/spring-flo/spring-flo.md",
                            ],
                            initialOpenGroupIndex: 0 // 可选的, 默认值是 0
                        }
                    ],
                    // fallback
                    '/': 
                        [{
                            title: 'Spring 文档', // 必要的
                            // path: '/', // 可选的, 标题的跳转链接，应为绝对路径且必须存在
                            collapsable: false, // 可选的, 默认值是 true,
                            sidebarDepth: 1, // 可选的, 默认值是 1
                            children: [
                                ''
                            ]
                        },
                        {
                            title: '介绍',
                            sidebarDepth: 2,
                            collapsable: false,
                            children: [
                                "why-spring.md",
                                "introducing-spring-boot.md",
                                "quickstart.md"
                            ],
                            initialOpenGroupIndex: 0 // 可选的, 默认值是 0
                        },
                        {
                            title: '教程',
                            sidebarDepth: 2,
                            collapsable: false,
                            children: [
                                "system-requirements.md",
                                "installing.md",
                                "initializr.md"
                            ],
                            initialOpenGroupIndex: 0 // 可选的, 默认值是 0
                        },
                        {
                            title: '编辑器',
                            sidebarDepth: 2,
                            collapsable: false,
                            children: [
                                "vscode_java.md",
                                "intellij_idea.md"
                            ],
                            initialOpenGroupIndex: 0 // 可选的, 默认值是 0
                        },
                        {
                            title: '代码案例',
                            sidebarDepth: 2,
                            collapsable: false,
                            children: [
                                "getting-started_first-application.md",
                                "rest-service.md",
                                "consuming-rest.md"
                            ],
                            initialOpenGroupIndex: 0 // 可选的, 默认值是 0
                        }
                    ]
                }
            }
        }
    }
}