PaiGramDocs/docs/.vitepress/config.ts

90 lines
3.0 KiB
TypeScript
Raw Normal View History

2023-10-20 17:15:41 +00:00
import { defineConfig } from 'vitepress'
import { withPwa } from '@vite-pwa/vitepress'
import { description, docsVersion, github, keywords, name, site } from './meta'
import { pwa } from './plugins/pwa'
import sidebar from './sidebar'
import socialLinks from './link'
2023-10-21 05:28:21 +00:00
import algolia from './algolia'
2023-10-20 17:15:41 +00:00
export default withPwa(defineConfig({
pwa,
outDir: '../dist',
title: name,
description,
appearance: true,
lastUpdated: true,
useWebFonts: false,
markdown: {
lineNumbers: true,
},
locales: {
root: { label: '简体中文', lang: 'zh-CN' },
},
themeConfig: {
logo: '/favicon.ico',
outline: 2,
docFooter: {
prev: '上一篇',
next: '下一篇',
},
returnToTopLabel: '返回顶部',
outlineTitle: '导航栏',
darkModeSwitchLabel: '外观',
sidebarMenuLabel: '归档',
editLink: {
pattern: `${github}/tree/vp/docs/:path`,
text: '在 GitHub 上编辑此页',
},
lastUpdatedText: '最后一次更新于',
footer: {
message: 'Telegram robot, query the official game information.',
copyright: 'Copyright © 2023 PaigramTeam. All rights reserved.',
},
nav: [
{
text: ' 📦️ Repo',
items: [
{ text: '✨ PaiGram', link: 'https://github.com/PaiGramTeam/PaiGram' },
{ text: '🚅 PamGram', link: 'https://github.com/PaiGramTeam/PamGram' },
{ text: '🎮 MibooGram', link: 'https://github.com/PaiGramTeam/MibooGram' },
],
},
{
text: `v${docsVersion}`,
items: [
{ text: '📝 Docs', link: github },
],
},
],
2023-10-21 05:28:21 +00:00
algolia,
2023-10-20 17:15:41 +00:00
sidebar,
socialLinks,
},
head: [
['meta', { name: 'referrer', content: 'no-referrer-when-downgrade' }],
['meta', { name: 'keywords', content: keywords }],
['meta', { name: 'author', content: 'PaigramTeam' }],
['meta', { property: 'og:type', content: 'article' }],
['meta', { name: 'application-name', content: name }],
['meta', { name: 'apple-mobile-web-app-title', content: name }],
['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'default' }],
['link', { rel: 'shortcut icon', href: '/favicon.ico' }],
['link', { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }],
['link', { rel: 'mask-icon', href: '/favicon.ico', color: '#06f' }],
['meta', { name: 'theme-color', content: '#06f' }],
['link', { rel: 'apple-touch-icon', sizes: '120x120', href: '/images/icons/apple-touch-icon.png' }],
// webfont
['link', { rel: 'dns-prefetch', href: 'https://fonts.googleapis.com' }],
['link', { rel: 'dns-prefetch', href: 'https://fonts.gstatic.com' }],
['link', { rel: 'preconnect', crossorigin: 'anonymous', href: 'https://fonts.googleapis.com' }],
['link', { rel: 'preconnect', crossorigin: 'anonymous', href: 'https://fonts.gstatic.com' }],
// og
['meta', { property: 'og:description', content: description }],
['meta', { property: 'og:url', content: site }],
['meta', { property: 'og:locale', content: 'zh_CN' }],
],
}))