|
1 | 1 | import { generateSitemap as sitemap } from 'sitemap-ts'
|
| 2 | +import { description, docsVersion, github, keywords, name, site } from './meta' |
2 | 3 | import sidebar from './sidebar'
|
3 | 4 | import socialLinks from './link'
|
4 | 5 | import algolia from './algolia'
|
5 | 6 |
|
6 | 7 | export default {
|
7 | 8 | outDir: '../dist',
|
8 |
| - title: 'ChoDocs', |
9 |
| - description: 'Front-end learning document collection.', |
| 9 | + title: name, |
| 10 | + description, |
10 | 11 | lastUpdated: true,
|
| 12 | + cleanUrls: true, |
| 13 | + useWebFonts: false, |
11 | 14 | markdown: {
|
12 | 15 | lineNumbers: true,
|
13 | 16 | },
|
14 |
| - head: [ |
15 |
| - [ |
16 |
| - 'meta', |
17 |
| - { name: 'referrer', content: 'no-referrer-when-downgrade' }, |
18 |
| - ], |
19 |
| - ], |
| 17 | + locales: { |
| 18 | + root: { label: '简体中文', lang: 'zh-CN' }, |
| 19 | + }, |
20 | 20 | themeConfig: {
|
21 | 21 | logo: './chodocs-logo.svg',
|
22 | 22 | outline: 'deep',
|
| 23 | + docFooter: { |
| 24 | + prev: '上一篇', |
| 25 | + next: '下一篇', |
| 26 | + }, |
| 27 | + returnToTopLabel: '返回顶部', |
| 28 | + outlineTitle: '导航栏', |
| 29 | + darkModeSwitchLabel: '外观', |
| 30 | + sidebarMenuLabel: '归档', |
| 31 | + editLink: { |
| 32 | + pattern: `${github}/tree/main/docs/:path`, |
| 33 | + text: '在 GitHub 上编辑此页', |
| 34 | + }, |
| 35 | + lastUpdatedText: '最后一次更新于', |
23 | 36 | footer: {
|
24 |
| - message: 'Released under the MIT License.', |
25 |
| - copyright: 'Copyright © 2022-PRESENT Chocolate and ChoDocs contributors', |
| 37 | + message: `用心去做高质量的专业前端内容网站,欢迎 <a target="_blank" style="color: var(--vp-c-brand)" href="${github}">star ⭐</a>,让更多人发现`, |
| 38 | + copyright: `<a target="_blank" href="${github}/blob/main/LICENSE">MIT License</a> | 版权所有 © 2022-${new Date().getFullYear()} <a target="_blank" href="${github}">Chocolate and ChoDocs contributors</a>`, |
26 | 39 | },
|
27 | 40 | nav: [
|
28 |
| - { text: '🔥 前端算法', link: '/algorithm/guide/' }, |
29 |
| - { text: '🔥 设计模式', link: '/patterns/guide/' }, |
30 |
| - { text: '💭 学习圈子', link: '/zsxq' }, |
31 |
| - { text: '⭐ 资源导航', link: '/favorites' }, |
32 |
| - { text: '📋 面试', link: '/interview/' }, |
| 41 | + { text: '学习圈子', link: '/zsxq' }, |
| 42 | + { |
| 43 | + text: '专栏', |
| 44 | + items: [ |
| 45 | + { text: '🔥 前端算法', link: '/algorithm/guide/' }, |
| 46 | + { text: '🔥 设计模式', link: '/patterns/guide/' }, |
| 47 | + { text: '📋 面试', link: '/interview/' }, |
| 48 | + ], |
| 49 | + }, |
33 | 50 | {
|
34 |
| - text: '更多', |
| 51 | + text: '编程', |
35 | 52 | items: [
|
| 53 | + { text: '⭐ 资源导航', link: '/favorites' }, |
36 | 54 | { text: '🔧 编程工具', link: '/tool/' },
|
| 55 | + ], |
| 56 | + }, |
| 57 | + { |
| 58 | + text: '洞见', |
| 59 | + items: [ |
37 | 60 | { text: '✏️ 随笔', link: '/essay/' },
|
38 | 61 | { text: '🌱 青葱岁月', link: '/green/ch' },
|
39 |
| - { text: '🎉 更新日志', link: 'https://github.com/chodocs/chodocs/releases' }, |
| 62 | + ], |
| 63 | + }, |
| 64 | + { |
| 65 | + text: `v${docsVersion}`, |
| 66 | + items: [ |
| 67 | + { text: '🧱 参与贡献', link: '/contributing' }, |
| 68 | + { text: '🎉 更新日志', link: `${github}/releases` }, |
40 | 69 | ],
|
41 | 70 | },
|
42 | 71 | ],
|
43 |
| - editLink: { |
44 |
| - pattern: 'https://github.com/chodocs/chodocs/tree/main/docs/:path', |
45 |
| - text: 'Suggest changes to this page', |
46 |
| - }, |
47 | 72 | algolia,
|
48 | 73 | sidebar,
|
49 | 74 | socialLinks,
|
50 | 75 | },
|
| 76 | + head: [ |
| 77 | + ['meta', { name: 'referrer', content: 'no-referrer-when-downgrade' }], |
| 78 | + ['meta', { name: 'keywords', content: keywords }], |
| 79 | + ['meta', { name: 'author', content: 'Choi Yang' }], |
| 80 | + ['meta', { property: 'og:type', content: 'article' }], |
| 81 | + ['meta', { name: 'application-name', content: name }], |
| 82 | + ['meta', { name: 'apple-mobile-web-app-title', content: name }], |
| 83 | + ['meta', { name: 'apple-mobile-web-app-status-bar-style', content: 'default' }], |
| 84 | + |
| 85 | + ['link', { rel: 'shortcut icon', href: '/favicon.ico' }], |
| 86 | + ['link', { rel: 'icon', type: 'image/x-icon', href: '/favicon.ico' }], |
| 87 | + ['link', { rel: 'mask-icon', href: '/chodocs-logo.svg', color: '#06f' }], |
| 88 | + ['meta', { name: 'theme-color', content: '#06f' }], |
| 89 | + // webfont |
| 90 | + ['link', { rel: 'dns-prefetch', href: 'https://fonts.googleapis.com' }], |
| 91 | + ['link', { rel: 'dns-prefetch', href: 'https://fonts.gstatic.com' }], |
| 92 | + ['link', { rel: 'preconnect', crossorigin: 'anonymous', href: 'https://fonts.googleapis.com' }], |
| 93 | + ['link', { rel: 'preconnect', crossorigin: 'anonymous', href: 'https://fonts.gstatic.com' }], |
| 94 | + // og |
| 95 | + ['meta', { property: 'og:description', content: description }], |
| 96 | + ['meta', { property: 'og:url', content: site }], |
| 97 | + ['meta', { property: 'og:locale', content: 'zh_CN' }], |
| 98 | + ], |
51 | 99 | async buildEnd() {
|
52 | 100 | await sitemap({ hostname: 'https://chodocs.cn/' })
|
53 | 101 | },
|
|
0 commit comments