dma_handbook/docs/.vuepress/config.js
2025-11-27 10:18:18 +08:00

128 lines
5.2 KiB
JavaScript

import { viteBundler } from '@vuepress/bundler-vite'
import { defaultTheme } from '@vuepress/theme-default'
import { defineUserConfig } from 'vuepress'
// import * as path from "path";
// const path = require("path");
// import {registerComponentsPlugin} from '@vuepress/plugin-register-components'
// const { registerComponentsPlugin } = require('@vuepress/plugin-register-components');
export default defineUserConfig({
// ...其他配置...
head: [
['meta', { name: 'og:type', content: 'website' }],
['meta', { property: 'og:title', content: 'DMA服务人员操作手册123' }],
['meta', { name: 'description', content: 'DMA服务操作手册' }],
['meta', { property: 'og:description', content: 'DMA服务全流程操作指南' }],
['meta', { property: 'og:image', content: 'https://images.health.ufutx.com/202503/12/1f227399ffc2ddbf6c58eafa80627d19.png?v=' + Date.now() }],
// ['meta', { property: 'og:image', content: 'https://images.health.ufutx.com/202503/12/1f227399ffc2ddbf6c58eafa80627d19.png?v=' + Date.now() }],
// ['meta', { name: 'twitter:image', content: 'https://images.health.ufutx.com/202503/12/1f227399ffc2ddbf6c58eafa80627d19.png?v=' + Date.now() }],
// ['meta', { property: 'og:url', content: 'https://example.com/article' }],
['link', { rel: 'icon', href: 'https://images.health.ufutx.com/202503/12/1f227399ffc2ddbf6c58eafa80627d19.png?v=' + Date.now() }],
// ['meta', { name: 'thumbnail', content: 'https://example.com/share-image.jpg' }],
// ['meta', { name: 'WeChat-Description', content: '点击查看完整DMA服务流程' }]
],
bundler: viteBundler({
// vite bundler options here
}),
theme: defaultTheme({
// default theme options here
navbar: [
'/',
{
text: '核心操作',
link: '/posts/overview',
activeMatch: '^/posts/overview',
},
{
text: '角色文档',
children: [
{ text: '主教练', link: '/posts/chiefCoach.html' },
{ text: '副教练', link: '/posts/assistantCoach.html' },
{ text: '客服', link: '/posts/service.html' },
{ text: '健康管理师', link: '/posts/teacher.html' },
],
},
{
text: '操作指南',
children: [
{ text: '分润提现', link: '/posts/shareBenefit' },
{ text: 'APP相关', link: '/posts/appCorrelation' },
{ text: 'DMA模块', link: '/posts/DMAModule' },
{ text: '考试预约', link: '/posts/examReservation' },
],
},
{ text: '常见问题', link: '/posts/helpCenter' },
{ text: '更新日志', link: '/posts/changelog' },
],
sidebar: ({ pagePath }) => {
// const sidebarMap = {
// '/posts': [
// {
// title: '主教练文档',
// collapsable: true,
// children: [
//
// ] // 移除.md后缀
// }
// ],
// '/posts/archive2': [
// {
// title: '副教练文档',
// collapsable: true,
// children: ['/posts/.md']
// }
// ],
// '/posts/article1': [
// {
// title: '客服文档',
// collapsable: true,
// children: ['/posts/.md']
// }
// ]
// };
// return sidebarMap[pagePath] || [];
}
}),
lang:'zh-CN',
title:'DMA服务人员服务操作手册',
description: 'DMA服务人员服务操作手册',
base:'/dma_handbook/',
image:'https://images.health.ufutx.com/202503/12/1f227399ffc2ddbf6c58eafa80627d19.png',
plugins: [
['@vuepress/plugin-medium-zoom', {
selector: 'img',
delay: 500,
lazy: true,
options: {
loading: 'lazy',
decoding: 'async',
// 添加交叉观察器配置
observer: true,
observerOptions: {
rootMargin: '0px',
threshold: 0.1
}
}
}],
// registerComponentsPlugin({
// // 配置项
// componentsDir: path.resolve(__dirname, '../../', 'components'), // 自动注册全局组件,
// })
// ['@vuepress/seo', {
// siteTitle: (_, $site) => 'TypeScript中文文档',
// title: $page => $page.title+'1321321',
// description: $page => $page.frontmatter.description,
// author: (_, $site) => '冴羽',
// type: $page => 'article',
// url: (_, $site, path) => 'https://ts.yayujs.com' + path,
// image: ($page, $site) => "https://www.typescriptlang.org/icons/icon-144x144.png",
// publishedAt: $page => $page.frontmatter.date && new Date($page.frontmatter.date),
// modifiedAt: $page => $page.lastUpdated && new Date($page.lastUpdated),
// }]
]
})