-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.ts
137 lines (131 loc) · 3.83 KB
/
config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
import { defineConfig } from "vuepress/config";
import navbar from "./navbar";
import sidebar from "./sidebar";
import footer from "./footer";
import extraSideBar from "./extraSideBar";
const author = "SmallTeddy";
const domain = "https://codefather.cn";
const tags = ["程序员", "算法", "leetcode"];
export default defineConfig({
title: "leetcode-practice-book",
description: "A powerful practice platform for leetcode.Using any way you want to create questions.",
head: [
// 站点图标
["link", { rel: "icon", href: "/favicon.ico" }],
// SEO
[
"meta",
{
name: "keywords",
content:
"程序员鱼皮, 编程学习路线, 编程知识百科, Java, 编程导航, 前端, 开发, 编程分享, 项目, IT, 求职, 面经",
},
],
// 百度统计
[
"script",
{},
`
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?2675818a983a3131404cee835018f016";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
`,
],
],
permalink: "/:slug",
// 监听文件变化,热更新
extraWatchFiles: [".vuepress/*.ts", ".vuepress/sidebars/*.ts"],
markdown: {
// 开启代码块的行号
lineNumbers: true,
// 支持 4 级以上的标题渲染
extractHeaders: ["h2", "h3", "h4", "h5", "h6"],
},
// @ts-ignore
plugins: [
["@vuepress/back-to-top"],
// Google 分析
[
"@vuepress/google-analytics",
{
ga: "GTM-WVS9HM6W", // 补充自己的谷歌分析 ID,比如 UA-00000000-0
},
],
["@vuepress/medium-zoom"],
// https://github.com/lorisleiva/vuepress-plugin-seo
[
"seo",
{
siteTitle: (_, $site) => $site.title,
title: ($page) => $page.title,
description: ($page) =>
$page.frontmatter.description || $page.description,
author: (_, $site) => $site.themeConfig.author || author,
tags: ($page) => $page.frontmatter.tags || tags,
type: ($page) => "article",
url: (_, $site, path) =>
($site.themeConfig.domain || domain || "") + path,
image: ($page, $site) =>
$page.frontmatter.image &&
(($site.themeConfig.domain &&
!$page.frontmatter.image.startsWith("http")) ||
"") + $page.frontmatter.image,
publishedAt: ($page) =>
$page.frontmatter.date && new Date($page.frontmatter.date),
modifiedAt: ($page) => $page.lastUpdated && new Date($page.lastUpdated),
},
],
// https://github.com/ekoeryanto/vuepress-plugin-sitemap
[
"sitemap",
{
hostname: domain,
},
],
// https://github.com/IOriens/vuepress-plugin-baidu-autopush
["vuepress-plugin-baidu-autopush"],
// https://github.com/zq99299/vuepress-plugin/tree/master/vuepress-plugin-tags
["vuepress-plugin-tags"],
// https://github.com/znicholasbrown/vuepress-plugin-code-copy
[
"vuepress-plugin-code-copy",
{
successText: "代码已复制",
},
],
// https://github.com/webmasterish/vuepress-plugin-feed
[
"feed",
{
canonical_base: domain,
count: 10000,
// 需要自动推送的文档目录
posts_directories: [],
},
],
// https://github.com/tolking/vuepress-plugin-img-lazy
["img-lazy"],
],
// 主题配置
themeConfig: {
logo: "/logo.png",
nav: navbar,
sidebar,
lastUpdated: "最近更新",
// GitHub 仓库位置
repo: "wh131462/leetcode-practice",
docsBranch: "master",
// 编辑链接
editLinks: true,
editLinkText: "完善页面",
// @ts-ignore
// 底部版权信息
footer,
// 额外右侧边栏
extraSideBar,
},
});