const setupContent = require("../setup/index");
const graphContent = require("../guides/index");

module.exports = {
    title: "数字化交付开发文档",
    description: "上格云数字化交付开发文档",
    base: "/doc/web/",
    plugins: [
        "@vuepress/last-updated",
        "plugin-back-to-top",
        [
            'vuepress-plugin-typescript',
            {
                tsLoaderOptions: {},
            },
        ],
        [
            'vuepress-plugin-mathjax',
            {
                target: 'svg',
                macros: {
                    '*': '\\times',
                },
            },
        ],
    ],
    markdown: {
        lineNumbers: true
    },
    themeConfig: {
        logo: "/assets/img/logo.png",
        nav: [{
                text: "首页",
                link: "/"
            },
            {
                text: "安装配置",
                items: [{
                        text: "开发环境",
                        items: [{
                                text: "IDEA",
                                link: "/setup/ide/idea"
                            },
                            {
                                text: "VS Code",
                                link: "/setup/ide/vscode"
                            },
                            {
                                text: "Node.js",
                                link: "/setup/ide/nodejs"
                            },
                        ]
                    },
                    {
                        text: "服务器",
                        items: [{
                                text: "Nginx",
                                link: "/setup/server/nginx"
                            },
                            {
                                text: "Tomcat",
                                link: "/setup/server/tomcat"
                            }
                        ]
                    },
                ]
            },
            {
                text: "开发文档",
                items: [
                    {
                        text: "引擎",
                        items: [
                            {text: "数据格式", link: "/guides/format/floorMap.md"},
                            {text: "图形引擎", link: "/guides/engine/"},
                            {text: "场景管理", link: "/guides/scene/"},
                            {text: "楼层平面图", link: "/guides/big/"},
                            // {text: "系统图", link: "/guides/system-diagram/"},
                            {text: "编辑器", link: "/guides/edit/"}
                        ]
                    },
                ]
            },
            {
                text: "API参考",
                items: [{
                        text: "图形引擎",
                        link: "http://adm.sagacloud.cn:8080/api/web/graph/"
                    },
                    {
                        text: "建筑信息图",
                        link: "http://adm.sagacloud.cn:8080/api/web/big/"
                    }
                ]
            }
        ],
        displayAllHeaders: true,
        sidebarDepth: 0,
        sidebar: {
            "/setup/": setupContent,
            "/guides/": graphContent
        }
    },
    module: {
        rules: [{
            test: /\.less$/,
            loader: 'less-loader', // compiles Less to CSS
        }, ],
    },
    devServer :{
        proxy: {
            '/git': {
                target: 'http://39.106.8.246:3003',
                changeOrigin: true,
                secure: false,
                pathRewrite: {
                    '^/git': '',
                },
            }
        }
    }
};