8000 feat(theme): update site info (#186) · chodocs/chodocs@bb241e3 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit bb241e3

Browse files
feat(theme): update site info (#186)
1 parent 001dde0 commit bb241e3

File tree

4 files changed

+96
-24
lines changed

4 files changed

+96
-24
lines changed

docs/.vitepress/algolia.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,9 @@ export default {
33
apiKey: '9ccfcfff5b8b2ca6318229be055a524b',
44
indexName: 'chocn',
55
placeholder: '请输入关键词',
6-
buttonText: '搜索',
6+
translations: {
7+
button: {
8+
buttonText: '搜索文档',
9+
},
10+
},
711
}

docs/.vitepress/config.ts

Lines changed: 69 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,101 @@
11
import { generateSitemap as sitemap } from 'sitemap-ts'
2+
import { description, docsVersion, github, keywords, name, site } from './meta'
23
import sidebar from './sidebar'
34
import socialLinks from './link'
45
import algolia from './algolia'
56

67
export default {
78
outDir: '../dist',
8-
title: 'ChoDocs',
9-
description: 'Front-end learning document collection.',
9+
title: name,
10+
description,
1011
lastUpdated: true,
12+
cleanUrls: true,
13+
useWebFonts: false,
1114
markdown: {
1215
lineNumbers: true,
1316
},
14-
head: [
15-
[
16-
'meta',
17-
{ name: 'referrer', content: 'no-referrer-when-downgrade' },
18-
],
19-
],
17+
locales: {
18+
root: { label: '简体中文', lang: 'zh-CN' },
19+
},
2020
themeConfig: {
2121
logo: './chodocs-logo.svg',
2222
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: '最后一次更新于',
2336
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>`,
2639
},
2740
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+
},
3350
{
34-
text: '更多',
51+
text: '编程',
3552
items: [
53+
{ text: '⭐ 资源导航', link: '/favorites' },
3654
{ text: '🔧 编程工具', link: '/tool/' },
55+
],
56+
},
57+
{
58+
text: '洞见',
59+
items: [
3760
{ text: '✏️ 随笔', link: '/essay/' },
3861
{ 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` },
4069
],
4170
},
4271
],
43-
editLink: {
44-
pattern: 'https://github.com/chodocs/chodocs/tree/main/docs/:path',
45-
text: 'Suggest changes to this page',
46-
},
4772
algolia,
4873
sidebar,
4974
socialLinks,
5075
},
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+
],
5199
async buildEnd() {
52100
await sitemap({ hostname: 'https://chodocs.cn/' })
53101
},

docs/.vitepress/meta.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { version } from '../../package.json'
2+
3+
// base info
4+
export const name = 'ChoDocs'
5+
export const site = 'https://chodocs.cn/'
6+
export const logo = 'https://chodocs.cn/chodocs-logo.svg'
7+
export const keywords = '前端专栏、学习路线、面试手册、知识体系、前端面试、前端算法、编程学习、bilibili、vitepress、随笔、资源导航、知识星球、chodocs、React、Vue、Next.js、思维导图、coding、github'
8+
export const description = '一站式前端内容网站,包括学习路线、知识体系,海量前端面试问题解答,一站式阅读体验,跟随前沿技术,深度和广度学习,React 与 Vue 生态。'
9+
10+
// social link
11+
export const bilibili = 'https://space.bilibili.com/351534170'
12+
export const github = 'https://github.com/chodocs/chodocs'
13+
14+
// docs version
15+
export const docsVersion = version

docs/index.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
---
22
layout: home
3+
4+
title: ChoDocs
5+
titleTemplate: 一站式前端内容网站,包括学习路线、知识体系
6+
37
hero:
48
name: ChoDocs
5-
text: Front-end learning document collection
6-
tagline: "一站式前端内容网站,包括学习路线、知识体系"
9+
text: "Front-end learning document collection"
10+
tagline: |
11+
一站式前端内容网站,包括学习路线、知识体系
712
image:
813
src: /it.svg
914
alt: ChoDocs

0 commit comments

Comments
 (0)
0