Repository navigation
Expand file tree
/
Copy pathdocusaurus.config.ts
More file actions
158 lines (148 loc) · 3.73 KB
/
Copy pathdocusaurus.config.ts
File metadata and controls
158 lines (148 loc) · 3.73 KB
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
import type * as Preset from '@docusaurus/preset-classic'
import type { Config } from '@docusaurus/types'
// Docusaurus resolves `baseUrl` for `favicon` and `themeConfig.image`, but not
// for `headTags` hrefs — those are emitted verbatim, so they have to be built
// from the same constant rather than hard-coded.
const baseUrl = '/impulse/'
const config: Config = {
title: 'Impulse',
tagline:
'Declarative gesture primitives for React Native on iOS, Android, and web (partial)',
url: 'https://rootnative.github.io',
baseUrl,
onBrokenLinks: 'throw',
onBrokenAnchors: 'throw',
markdown: {
hooks: {
onBrokenMarkdownLinks: 'warn',
},
},
// A PNG, not an `.ico`. `scripts/build-brand.mjs` carries a hand-written PNG
// encoder and no ICO writer, and every browser in the support band reads a
// PNG favicon. Adding an `.ico` means porting `inertia`'s `buildIco`.
favicon: 'img/favicon.png',
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
headTags: [
{
tagName: 'link',
attributes: {
rel: 'apple-touch-icon',
sizes: '180x180',
href: `${baseUrl}img/favicon.png`,
},
},
{
tagName: 'link',
attributes: {
rel: 'preconnect',
href: 'https://fonts.googleapis.com',
},
},
{
tagName: 'link',
attributes: {
rel: 'preconnect',
href: 'https://fonts.gstatic.com',
crossorigin: 'anonymous',
},
},
{
tagName: 'link',
attributes: {
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600&display=swap',
},
},
],
presets: [
[
'classic',
{
docs: {
sidebarPath: './sidebars.ts',
routeBasePath: '/',
editUrl: 'https://github.com/rootnative/impulse/edit/main/docs/',
},
blog: false,
theme: {
customCss: './src/css/custom.css',
},
} satisfies Preset.Options,
],
],
themes: [
[
'@easyops-cn/docusaurus-search-local',
{
hashed: true,
docsRouteBasePath: '/',
indexBlog: false,
},
],
],
themeConfig: {
colorMode: {
respectPrefersColorScheme: true,
},
navbar: {
title: 'Impulse',
logo: {
alt: 'Impulse',
src: 'img/logo.svg',
srcDark: 'img/logo-dark.svg',
},
items: [
{
type: 'docSidebar',
sidebarId: 'docs',
label: 'Docs',
position: 'left',
},
{
href: 'https://rootnative.github.io/impulse/example/',
label: 'Example',
position: 'right',
},
{
href: 'https://github.com/rootnative/impulse',
position: 'right',
className: 'navbar-github-link',
'aria-label': 'GitHub repository',
},
],
},
footer: {
links: [
{
title: 'Docs',
items: [{ label: 'Introduction', to: '/introduction' }],
},
{
title: 'More',
items: [
{
label: 'Example app',
href: 'https://rootnative.github.io/impulse/example/',
},
{
label: 'GitHub',
href: 'https://github.com/rootnative/impulse',
},
{
label: 'npm',
href: 'https://www.npmjs.com/package/@rootnative/impulse',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} RootNative — MIT Licensed`,
},
prism: {
additionalLanguages: ['bash'],
},
} satisfies Preset.ThemeConfig,
}
export default config