-
Notifications
You must be signed in to change notification settings - Fork 18
/
docusaurus.config.ts
115 lines (111 loc) · 3.47 KB
/
docusaurus.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
import type { Config} from '@docusaurus/types'
import type { Options } from '@docusaurus/preset-classic'
const config: Config = {
title: 'Python Guide for Javascript Engineers',
tagline: 'Python, JavaScript, programming, experience, tutorials, open source, free, eBooks, downloads, PDF, examples',
url: 'https://luckrnx09.com',
baseUrl: '/python-guide-for-javascript-engineers/',
trailingSlash: false,
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'throw',
favicon: 'img/favicon.ico',
projectName: 'python-guide-for-javascript-engineers',
presets: [
[
'classic',
({
docs: {
path: './docs',
sidebarPath: './sidebars.ts',
routeBasePath: '/',
sidebarCollapsed: false,
editUrl: 'https://github.com/luckrnx09/python-guide-for-javascript-engineers/edit/main/',
editLocalizedFiles: true,
},
blog: false,
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
sitemap: {
changefreq: 'weekly',
priority: 0.5,
}
}) as Options,
],
],
themeConfig: (
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
{
docs: {
sidebar: {
hideable: true,
},
},
colorMode: {
defaultMode: 'light',
disableSwitch: false,
respectPrefersColorScheme: true,
},
navbar: {
hideOnScroll: true,
title: 'Python Guide for JavaScript Engineers',
items: [
{
type: 'localeDropdown',
position: 'left',
},
{
label:'Github',
position: 'right',
href:'https://github.com/luckrnx09/python-guide-for-javascript-engineers'
},
],
logo: {
alt: 'Python Guide for JavaScript Engineers',
href: '/',
src: './img/favicon.ico'
},
},
metadata: [
{ name: 'keywords', content: 'Python, JavaScript, Programming, Experience, Tutorial, Open Source, Free, eBook, Download, PDF, Examples' },
{ name: 'description', content: 'The Python Guide for JavaScript Engineers is an open source ebook that covers everything from Python environment installation to project development. This book compares the similarities and differences between JavaScript and Python through cases to help JavaScript engineers quickly master the Python language.' },
{ name: 'author', content: 'luckrnx09' },
],
}
),
plugins: [
function (context, options) {
return {
name: 'baidu-plugin',
injectHtmlTags({ content }) {
return {
postBodyTags: [`
<script type="text/javascript">
(function(c,l,a,r,i,t,y){
c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)};
t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i;
y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y);
})(window, document, "clarity", "script", "k0fttuea53");
</script>
`],
};
},
};
},
[
require.resolve("@easyops-cn/docusaurus-search-local"),
{
hashed: true,
language: ["en", "zh"],
docsRouteBasePath: "/",
highlightSearchTermsOnTargetPage: true,
},
],
],
stylesheets: [],
i18n: {
defaultLocale: 'en',
locales: ['en', 'zh-cn'],
},
};
module.exports = config;