|
1 | | -/** @type {import('@docusaurus/types').DocusaurusConfig} */ |
2 | | -module.exports = { |
3 | | - title: 'React Native Boilerplate', |
4 | | - tagline: 'Ready to use react native architecture based on Separation of Concerns.', |
| 1 | +// @ts-check |
| 2 | +// Note: type annotations allow type checking and IDEs autocompletion |
| 3 | + |
| 4 | +const lightCodeTheme = require('prism-react-renderer/themes/github'); |
| 5 | +const darkCodeTheme = require('prism-react-renderer/themes/dracula'); |
| 6 | + |
| 7 | +/** @type {import('@docusaurus/types').Config} */ |
| 8 | +const config = { |
| 9 | + title: 'The React Native Boilerplate', |
| 10 | + tagline: 'Simple, Lightweight and Scalable.', |
5 | 11 | url: 'https://thecodingmachine.github.io', |
6 | 12 | baseUrl: '/react-native-boilerplate/', |
7 | | - onBrokenLinks: 'warn', |
| 13 | + onBrokenLinks: 'throw', |
8 | 14 | onBrokenMarkdownLinks: 'warn', |
9 | 15 | favicon: 'img/favicon.png', |
10 | 16 | organizationName: 'thecodingmachine', |
11 | 17 | projectName: 'react-native-boilerplate', |
12 | | - themeConfig: { |
13 | | - algolia: { |
14 | | - apiKey: '870ae81ec981530781f32849c55a593f', |
15 | | - indexName: 'rnboilerplate', |
16 | | - contextualSearch: true, |
17 | | - }, |
18 | | - navbar: { |
19 | | - title: 'RNBoilerplate', |
20 | | - logo: { |
21 | | - alt: 'React Native Boilerplate', |
22 | | - src: 'img/TOM-small.png', |
23 | | - }, |
24 | | - items: [ |
25 | | - { |
26 | | - to: 'docs/Introduction', |
27 | | - activeBasePath: 'docs', |
28 | | - label: 'Docs', |
29 | | - position: 'left', |
30 | | - }, |
31 | | - { |
32 | | - to: '/blog', |
33 | | - label: 'Blog', |
34 | | - position: 'left' |
35 | | - }, |
36 | | - { |
37 | | - href: 'https://github.com/thecodingmachine/react-native-boilerplate', |
38 | | - label: 'GitHub', |
39 | | - position: 'right', |
| 18 | + i18n: { |
| 19 | + defaultLocale: 'en', |
| 20 | + locales: ['en'], |
| 21 | + }, |
| 22 | + plugins: [ |
| 23 | + async function myPlugin() { |
| 24 | + return { |
| 25 | + name: 'docusaurus-tailwindcss', |
| 26 | + configurePostCss(postcssOptions) { |
| 27 | + // eslint-disable-next-line global-require |
| 28 | + postcssOptions.plugins.push(require('tailwindcss')); |
| 29 | + // eslint-disable-next-line global-require |
| 30 | + postcssOptions.plugins.push(require('autoprefixer')); |
| 31 | + return postcssOptions; |
40 | 32 | }, |
41 | | - ], |
42 | | - }, |
43 | | - footer: { |
44 | | - style: 'dark', |
45 | | - logo: { |
46 | | - alt: 'Facebook Open Source Logo', |
47 | | - src: 'img/TOM.png', |
48 | | - }, |
49 | | - copyright: `Copyright © ${new Date().getFullYear()} TheCodingMachine, Inc. Built with Docusaurus.`, |
| 33 | + }; |
50 | 34 | }, |
51 | | - }, |
| 35 | + ], |
52 | 36 | presets: [ |
53 | 37 | [ |
54 | | - '@docusaurus/preset-classic', |
55 | | - { |
| 38 | + 'classic', |
| 39 | + /** @type {import('@docusaurus/preset-classic').Options} */ |
| 40 | + ({ |
56 | 41 | docs: { |
57 | 42 | sidebarPath: require.resolve('./sidebars.js'), |
58 | 43 | editUrl: |
59 | 44 | 'https://github.com/thecodingmachine/react-native-boilerplate/edit/master/website-documentation/docs', |
60 | 45 | }, |
61 | 46 | blog: { |
62 | 47 | showReadingTime: true, |
63 | | - // Please change this to your repo. |
64 | 48 | editUrl: |
65 | 49 | 'https://github.com/thecodingmachine/react-native-boilerplate/edit/master/website-documentation/blog', |
66 | 50 | }, |
67 | 51 | theme: { |
68 | 52 | customCss: require.resolve('./src/css/custom.css'), |
69 | 53 | }, |
70 | | - }, |
| 54 | + }), |
71 | 55 | ], |
72 | 56 | ], |
| 57 | + |
| 58 | + themeConfig: |
| 59 | + /** @type {import('@docusaurus/preset-classic').ThemeConfig} */ |
| 60 | + ({ |
| 61 | + algolia: { |
| 62 | + appId: '9PEYN0H12D', |
| 63 | + indexName: 'rnboilerplate', |
| 64 | + apiKey: '870ae81ec981530781f32849c55a593f', |
| 65 | + contextualSearch: true, |
| 66 | + }, |
| 67 | + colorMode: { |
| 68 | + respectPrefersColorScheme: true, |
| 69 | + }, |
| 70 | + navbar: { |
| 71 | + title: 'React Native Boilerplate', |
| 72 | + logo: { |
| 73 | + alt: 'React Native Boilerplate', |
| 74 | + src: 'img/TOM-small.png', |
| 75 | + }, |
| 76 | + items: [ |
| 77 | + { |
| 78 | + type: 'doc', |
| 79 | + docId: 'Introduction', |
| 80 | + position: 'left', |
| 81 | + label: 'Docs', |
| 82 | + }, |
| 83 | + { to: '/blog', label: 'Blog', position: 'left' }, |
| 84 | + { |
| 85 | + href: 'https://github.com/thecodingmachine/react-native-boilerplate', |
| 86 | + label: 'GitHub', |
| 87 | + position: 'right', |
| 88 | + }, |
| 89 | + ], |
| 90 | + }, |
| 91 | + footer: { |
| 92 | + style: 'dark', |
| 93 | + links: [ |
| 94 | + { |
| 95 | + title: 'Docs', |
| 96 | + items: [ |
| 97 | + { |
| 98 | + label: 'Installation', |
| 99 | + to: '/docs/Installation', |
| 100 | + }, |
| 101 | + { |
| 102 | + label: 'Theme', |
| 103 | + to: '/docs/Theme', |
| 104 | + }, |
| 105 | + { |
| 106 | + label: 'Loading data at startup', |
| 107 | + to: '/docs/SplashScreenLoadingData', |
| 108 | + }, |
| 109 | + { |
| 110 | + label: 'Redux toolkit', |
| 111 | + to: '/docs/ReduxStore', |
| 112 | + }, |
| 113 | + { |
| 114 | + label: 'Internationalization', |
| 115 | + to: '/docs/AddALangTranslation', |
| 116 | + }, |
| 117 | + ], |
| 118 | + }, |
| 119 | + { |
| 120 | + title: 'More', |
| 121 | + items: [ |
| 122 | + { |
| 123 | + label: 'Blog', |
| 124 | + to: '/blog', |
| 125 | + }, |
| 126 | + { |
| 127 | + label: 'GitHub', |
| 128 | + href: 'https://github.com/thecodingmachine/react-native-boilerplate', |
| 129 | + }, |
| 130 | + ], |
| 131 | + }, |
| 132 | + ], |
| 133 | + copyright: `Copyright © ${new Date().getFullYear()} React Native Boilerplate, by TheCodingMachine. Built with Docusaurus.`, |
| 134 | + }, |
| 135 | + prism: { |
| 136 | + theme: lightCodeTheme, |
| 137 | + darkTheme: darkCodeTheme, |
| 138 | + }, |
| 139 | + }), |
73 | 140 | }; |
| 141 | + |
| 142 | +module.exports = config; |
0 commit comments