Files
DAO_DE_JING/.vitepress/config.mts
T
dekun a8907d6cc0 Improve mobile reading layout and typography
Make classic text chapters easier to read on phones with responsive styles, collapsed sidebar groups, and less intrusive install prompts on doc pages.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-05 17:57:57 +08:00

81 lines
2.8 KiB
TypeScript

import path from 'node:path'
import { fileURLToPath } from 'node:url'
import { defineConfig } from 'vitepress'
import { createPwaPlugin } from './pwa.mts'
import { missingAssetsPlugin } from './missing-assets-plugin.mjs'
import { generateRewrites } from './rewrites.mts'
import { generateSidebar } from './sidebar.mts'
const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..')
export default defineConfig({
title: 'DAO DE JING',
description: '传统文化典籍资料库',
lang: 'zh-CN',
srcDir: '.',
rewrites: generateRewrites(),
srcExclude: [
'**/node_modules/**',
'**/.vitepress/**',
'**/server/**',
'**/金瓶梅/**',
'**/黄帝内经/**',
'.env.production',
'**/健康学习到150岁 - 人体系统调优不完全指南/**',
'**/梅花/**',
],
cleanUrls: true,
ignoreDeadLinks: true,
head: [
['link', { rel: 'icon', href: '/favicon.ico', sizes: 'any' }],
['link', { rel: 'shortcut icon', href: '/favicon.ico' }],
['link', { rel: 'icon', href: '/favicon.svg', type: 'image/svg+xml' }],
['link', { rel: 'icon', href: '/favicon.png', type: 'image/png', sizes: '512x512' }],
['link', { rel: 'apple-touch-icon', href: '/apple-touch-icon.png', sizes: '180x180' }],
['link', { rel: 'manifest', href: '/site.webmanifest' }],
['meta', { name: 'theme-color', content: '#0f3460' }],
['meta', { name: 'msapplication-TileColor', content: '#0f3460' }],
['meta', { name: 'msapplication-TileImage', content: '/apple-touch-icon.png' }],
['meta', { name: 'apple-mobile-web-app-title', content: '道德经' }],
['meta', { name: 'application-name', content: '道德经' }],
['meta', { name: 'mobile-web-app-capable', content: 'yes' }],
['meta', { name: 'apple-mobile-web-app-capable', content: 'yes' }],
['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'black-translucent' }],
[
'meta',
{
name: 'viewport',
content: 'width=device-width, initial-scale=1.0, viewport-fit=cover',
},
],
],
themeConfig: {
logo: { src: '/favicon.ico', width: 24, height: 24 },
sidebarMenuLabel: '目录',
returnToTopLabel: '回到顶部',
docFooter: {
prev: '上一篇',
next: '下一篇',
},
nav: [
{ text: '首页', link: '/' },
{ text: '五行', link: '/金、木、水、火、土 - 五行/' },
{ text: '道德经', link: '/道德经/01' },
{ text: '周易', link: '/周易/' },
{ text: '中医', link: '/中医宝典/' },
],
sidebar: generateSidebar(),
outline: { level: [2, 3], label: '本页目录' },
search: {
provider: 'local',
},
},
vite: {
plugins: [missingAssetsPlugin(), createPwaPlugin()],
server: {
host: '0.0.0.0',
},
publicDir: path.join(root, '.vitepress', 'public'),
},
})