Files
gongxue-new/docs/.vitepress/config.ts

54 lines
1.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { defineConfig } from 'vitepress'
const defaultOgImage = 'https://fenxiang-1304851894.cos.ap-nanjing.myqcloud.com/%E5%B0%81%E9%9D%A2.png'
export default defineConfig({
cleanUrls: 'with-subfolders',
title: '恭学教育集团',
description: '恭学教育集团是天津专升本培训领军品牌专注天津专升本7年已服务21万+学员。提供专业刷题系统、在线网校、权威教材和一对一升学规划真题覆盖率100%,助你轻松升本成功!',
lang: 'zh-CN',
head: [
['link', { rel: 'icon', href: '/logo.png' }],
['meta', { name: 'keywords', content: '天津专升本,专升本培训,恭学教育,天津专升本刷题,专升本网校,天津专升本教材,专升本辅导,天津专升本报名,专升本真题,天津专升本课程' }],
['meta', { property: 'og:image', content: defaultOgImage }],
],
themeConfig: {
logo: '/logo.png',
nav: [],
outline: false,
socialLinks: [],
},
vite: {
resolve: {
alias: {
'@': '/docs/.vitepress',
},
},
plugins: [
{
name: 'knowledge-index-redirect',
configureServer(server) {
server.middlewares.use((req, res, next) => {
if (req.url === '/knowledge') {
res.statusCode = 302
res.setHeader('Location', '/knowledge/')
res.end()
return
}
next()
})
},
},
],
},
transformHead({ pageData }) {
const keywords = pageData.frontmatter.keywords
if (keywords && Array.isArray(keywords)) {
return [
['meta', { name: 'keywords', content: keywords.join(',') }],
]
}
return []
},
})