This repository has been archived by the owner on Aug 9, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
docusaurus.config.js
158 lines (145 loc) · 4.56 KB
/
docusaurus.config.js
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const lightCodeTheme = require("./src/theme/CodeBlock/highlighting-light.js");
const darkCodeTheme = require("./src/theme/CodeBlock/highlighting-dark.js");
const webpack = require("webpack");
/** @type {import('@docusaurus/types').Config} */
const config = {
title: "React Native Reanimated",
favicon: "img/favicon.ico",
// Set the production url of your site here
url: "https://reanimated-beta-docs.swmansion.com",
// Change this to /react-native-reanimated/ when deploying to GitHub pages
baseUrl: "/",
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: "software-mansion", // Usually your GitHub org/user name.
projectName: "react-native-reanimated", // Usually your repo name.
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "throw",
// Even if you don't use internalization, you can use this field to set useful
// metadata like html lang. For example, if your site is Chinese, you may want
// to replace "en" with "zh-Hans".
i18n: {
defaultLocale: "en",
locales: ["en"],
},
presets: [
[
"classic",
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
breadcrumbs: false,
sidebarPath: require.resolve("./sidebars.js"),
sidebarCollapsible: false,
editUrl:
"https://github.com/software-mansion-labs/reanimated-3-docs/edit/main/",
lastVersion: "current", // <- this makes 3.x docs as default
versions: {
current: {
label: "3.x",
},
},
},
theme: {
customCss: require.resolve("./src/css/index.css"),
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
image: "img/og-image.png",
metadata: [
{ name: "og:image:width", content: "1200" },
{ name: "og:image:height", content: "630" },
],
navbar: {
title: "React Native Reanimated",
hideOnScroll: true,
logo: {
alt: "React Native Reanimated",
src: "img/logo.svg",
srcDark: "img/logo-dark.svg",
},
items: [
{
type: "docsVersionDropdown",
position: "right",
dropdownActiveClassDisabled: true,
},
{
href: "https://github.com/software-mansion/react-native-reanimated/",
position: "right",
className: "header-github",
"aria-label": "GitHub repository",
},
],
},
footer: {
style: "light",
links: [],
copyright:
"All trademarks and copyrights belong to their respective owners.",
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
},
algolia: {
appId: "ZYDVCHOETY",
apiKey: "970f691c8f65d958052968251a7b5a19",
indexName: "react-native-reanimated",
},
announcementBar: {
id: "beta_banner",
content:
"This is a beta version of the documentation. For stable version, please visit <a href='https://docs.swmansion.com/react-native-reanimated/'>docs.swmansion.com/react-native-reanimated</a>.",
backgroundColor: "#ffffff",
textColor: "#091E42",
isCloseable: false,
},
}),
plugins: [
...[
process.env.NODE_ENV === "production" && "@docusaurus/plugin-debug",
].filter(Boolean),
async function reanimatedDocusaurusPlugin(context, options) {
return {
name: "react-native-reanimated/docusaurus-plugin",
configureWebpack(config, isServer, utils) {
const processMock = !isServer ? { process: { env: {} } } : {};
const raf = require("raf");
raf.polyfill();
return {
mergeStrategy: {
"resolve.extensions": "prepend",
},
plugins: [
new webpack.DefinePlugin({
...processMock,
__DEV__: "false",
setImmediate: () => {},
}),
],
module: {
rules: [
{
test: /\.txt/,
type: "asset/source",
},
],
},
resolve: {
alias: { "react-native$": "react-native-web" },
extensions: [".web.js", "..."],
},
};
},
};
},
],
};
module.exports = config;