const path = require("path");
const { config, themeConfig } = require("vuepress-theme-hope");

module.exports = config({
  title: "spug devOps 发布平台技术文档平台",
  theme: "vuepress-theme-hope",
  description: "spug devOps 发布平台与项目接入规范",
  markdown: {
    lineNumbers: true, // 代码块显示行号
  },
  smoothScroll: true,
  port: 5000,
  // base: '/ui/',
  evergreen: true,
  hostname: "http://test.com",
  head: [
    // react 需要 React, ReactDOM 和 Babel 库
    // vue 只需要 vue 库
    ["script", { src: "https://cdn.jsdelivr.net/npm/vue/dist/vue.min.js" }],
  ],
  // plugins: {
  //   "@vuepress/medium-zoom": {
  //     selector: ".theme-note-content img",
  //     options: {
  //       margin: 0,
  //       background: "rgba(0,0,0,.4)"
  //     }
  //   },
  //   "@vuepress/active-header-links": {
  //     sidebarLinkSelector: ".sidebar-link",
  //     headerAnchorSelector: ".header-anchor"
  //   }
  // },
  themeConfig: {
    blog: false,
    smoothScroll: true,
    mdEnhance: {
      tasklist: true,
      flowchart: true,
      mermaid: true,
      demo: true,
      align: true,
      mark: true,
    },
    lastUpdated: "上次更新",
    // repo: "JackRay-c/vuepress-theme-note",

    docsBranch: "gh-pages",

    editLinkText: "帮助我们改善此页面！",

    displayAllHeaders: true,
    activeHeaderLinks: true,

    // algolia: {
    //     apiKey: '005d7d949bd2c403ee056670a5c60044',
    //     indexName: ''
    // },
    nav: [
      { text: "教程", link: "/course" },
      { text: "分支规范", link: "/branch" },
      { text: "流程规范", link: "/flow" },
      { text: "技术支持", link: "/support" },
      // { text: "Event", link: "/event/" },
      // { text: "2D", link: "/2d/" },
      // { text: "3D", link: "/3d/" },
      // { text: "硬装部分", link: "/hardfix/" }
    ],
    sidebar: {
      // "/base/": [
      //   {
      //     title: "基础架构", // 必要的
      //     collapsable: false, // 可选的, 默认值是 true,建议改为false
      //     sidebarDepth: 1, // 可选的, 默认值是 1，建议改为0
      //     children: ["", "develop"]
      //   }
      // ],
      // "/component/": [
      //   {
      //     title: "components(组件)",
      //     collapsable: false,
      //     sidebarDepth: 1,
      //     children: ["", "basic", "shared"]
      //   }
      // ],
      // "/event/": [
      //   {
      //     title: "事件", // 必要的
      //     collapsable: false, // 可选的, 默认值是 true,建议改为false
      //     sidebarDepth: 0, // 可选的, 默认值是 1，建议改为0
      //     children: ["inspect","boxstool", "switchView", "moveCanvas"]
      //   }
      // ],
      // "/hardfix/": [
      //   {
      //     title: "目录", // 必要的
      //     collapsable: false, // 可选的, 默认值是 true,建议改为false
      //     sidebarDepth: 0, // 可选的, 默认值是 1，建议改为0
      //     children: ["", "open"]
      //   }
      // ]
    },
  },
  configureWebpack: {
    resolve: {
      alias: {
        "@": path.join(__dirname, "../../src/"),
      },
    },
  },
});
