|
| 1 | +/** @type {import('@docusaurus/types').Config} */ |
| 2 | +const config = { |
| 3 | + title: 'JavaScript 工程师的 Python 指南', |
| 4 | + tagline: 'Python, JavaScript, 编程, 经验, 教程, 开源, 免费, 电子书, 下载, PDF, 示例', |
| 5 | + url: 'https://luckrnx09.github.io', |
| 6 | + baseUrl: '/books/python-guide-for-javascript-engineers/', |
| 7 | + onBrokenLinks: 'throw', |
| 8 | + onBrokenMarkdownLinks: 'throw', |
| 9 | + favicon: 'img/favicon.ico', |
| 10 | + projectName: 'python-guide-for-javascript-engineers', |
| 11 | + presets: [ |
| 12 | + [ |
| 13 | + 'classic', |
| 14 | + /** @type {import('@docusaurus/preset-classic').Options} */ |
| 15 | + ({ |
| 16 | + docs: { |
| 17 | + sidebarPath: require.resolve('./sidebars.js'), |
| 18 | + sidebarCollapsed: false, |
| 19 | + editUrl: 'https://github.com/luckrnx09/python-guide-for-javascript-engineers/edit/main/', |
| 20 | + routeBasePath: '/', |
| 21 | + path: './docs', |
| 22 | + editLocalizedFiles: false, |
| 23 | + }, |
| 24 | + blog: false, |
| 25 | + theme: { |
| 26 | + customCss: require.resolve('./src/css/custom.css'), |
| 27 | + }, |
| 28 | + sitemap: { |
| 29 | + changefreq: 'weekly', |
| 30 | + priority: 0.5, |
| 31 | + } |
| 32 | + }), |
| 33 | + ], |
| 34 | + ], |
| 35 | + |
| 36 | + themeConfig: ( |
| 37 | + /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ |
| 38 | + { |
| 39 | + docs: { |
| 40 | + sidebar: { |
| 41 | + hideable: true, |
| 42 | + }, |
| 43 | + }, |
| 44 | + colorMode: { |
| 45 | + defaultMode: 'light', |
| 46 | + disableSwitch: false, |
| 47 | + respectPrefersColorScheme: true, |
| 48 | + }, |
| 49 | + navbar: { |
| 50 | + hideOnScroll: true, |
| 51 | + title: 'JavaScript 工程师的 Python 指南', |
| 52 | + items: [ |
| 53 | + { |
| 54 | + label:'Github', |
| 55 | + position: 'right', |
| 56 | + href:'https://github.com/luckrnx09/python-guide-for-javascript-engineers' |
| 57 | + }, |
| 58 | + ], |
| 59 | + logo: { |
| 60 | + alt: 'JavaScript 工程师的 Python 指南', |
| 61 | + href: '/', |
| 62 | + src: './img/favicon.ico' |
| 63 | + }, |
| 64 | + }, |
| 65 | + metadata: [ |
| 66 | + { name: 'keywords', content: 'Python, JavaScript, 编程, 经验, 教程, 开源, 免费, 电子书, 下载, PDF, 示例' }, |
| 67 | + { name: 'description', content: '《JavaScript 工程师的 Python 指南》,是一本的开源电子书,囊括从 Python 环境安装到项目开发所需要的各种知识。本书通过案例对比 JavaScript 和 Python 的异同,帮助 JavaScript 工程师快速掌握 Python 语言。' }, |
| 68 | + { name: 'author', content: 'luckrnx09' }, |
| 69 | + ], |
| 70 | + } |
| 71 | + ), |
| 72 | + plugins: [ |
| 73 | + function (context, options) { |
| 74 | + return { |
| 75 | + name: 'baidu-plugin', |
| 76 | + injectHtmlTags({ content }) { |
| 77 | + return { |
| 78 | + postBodyTags: [` |
| 79 | + <script type="text/javascript"> |
| 80 | + (function(c,l,a,r,i,t,y){ |
| 81 | + c[a]=c[a]||function(){(c[a].q=c[a].q||[]).push(arguments)}; |
| 82 | + t=l.createElement(r);t.async=1;t.src="https://www.clarity.ms/tag/"+i; |
| 83 | + y=l.getElementsByTagName(r)[0];y.parentNode.insertBefore(t,y); |
| 84 | + })(window, document, "clarity", "script", "k0fttuea53"); |
| 85 | + </script> |
| 86 | + `], |
| 87 | + }; |
| 88 | + }, |
| 89 | + }; |
| 90 | + }, |
| 91 | + [ |
| 92 | + require.resolve("@easyops-cn/docusaurus-search-local"), |
| 93 | + { |
| 94 | + hashed: true, |
| 95 | + language: ["zh"], |
| 96 | + docsRouteBasePath: "/", |
| 97 | + highlightSearchTermsOnTargetPage: true, |
| 98 | + }, |
| 99 | + ], |
| 100 | + ], |
| 101 | + stylesheets: [], |
| 102 | + i18n: { |
| 103 | + defaultLocale: 'zh-cn', |
| 104 | + locales: ['zh-cn'], |
| 105 | + localeConfigs: { |
| 106 | + 'zh-cn': { |
| 107 | + label: '中文', |
| 108 | + direction: 'ltr', |
| 109 | + }, |
| 110 | + }, |
| 111 | + }, |
| 112 | +}; |
| 113 | + |
| 114 | +module.exports = config; |
0 commit comments