Repository navigation
Expand file tree
/
Copy pathdocusaurus.config.ts
More file actions
279 lines (264 loc) · 9.05 KB
/
Copy pathdocusaurus.config.ts
File metadata and controls
279 lines (264 loc) · 9.05 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
import type * as Preset from "@docusaurus/preset-classic";
import type { Config } from "@docusaurus/types";
import { themes as prismThemes } from "prism-react-renderer";
import remarkTokenReplacer from "./src/plugins/replace-tokens";
import latestVersions from "./src/plugins/latest-versions";
import { removedChangelogPages } from "./src/config/removedChangelogPages";
import { removedListPages } from "./src/config/removedListPages";
import recipeCatalogRedirects from "./src/config/recipe-catalog-redirects.json";
const description = "Large-scale automated source code refactoring"
const structuredData = {
'@context': 'https://schema.org',
'@type': 'SoftwareApplication',
name: 'OpenRewrite',
operatingSystem: 'Windows, macOS, Linux',
applicationCategory: 'ProductivityApplication',
description,
author: {
'@type': 'Organization',
name: 'Moderne',
},
datePublished: new Date(),
softwareVersion: latestVersions["{{VERSION_ORG_OPENREWRITE_REWRITE_CORE}}"],
downloadUrl: 'https://github.com/openrewrite/rewrite/releases',
video: {
'@type': 'VideoObject',
name: "Migrate to Java 21 using OpenRewrite",
description: "This recipe will apply changes commonly needed when migrating to Java 21. This recipe will also replace deprecated API with equivalents when there is a clear migration strategy. Build files will also be updated to use Java 21 as the target/source and plugins will be also be upgraded to versions that are compatible with Java 21.",
thumbnailUrl: "https://i.ytimg.com/vi/uViRlX-RahA/hqdefault.jpg?sqp=-oaymwEnCNACELwBSFryq4qpAxkIARUAAIhCGAHYAQHiAQoIGBACGAY4AUAB&rs=AOn4CLCBmYPSz3dMNEQR7pseLWsVszXd2A",
uploadDate: new Date("Feb 13, 2024 "),
contentUrl: "https://www.youtube.com/watch?v=uViRlX-RahA",
embedUrl: "https://www.youtube.com/embed/uViRlX-RahA?si=v1T7sLsQJ4YQdWPo",
},
};
const config: Config = {
title: "OpenRewrite Docs",
headTags: [
{
tagName: 'script',
attributes: {
type: 'application/ld+json',
},
innerHTML: JSON.stringify(structuredData),
},
// Runs before hydration so the notice bar does not flash for visitors who
// already dismissed it. The key and attribute must match
// src/theme/AnnouncementBar/index.tsx.
{
tagName: 'script',
attributes: {},
innerHTML: `try {
if (window.localStorage.getItem('code-genome-project-announcement-dismissed') === 'true') {
document.documentElement.setAttribute('data-notice-bar-dismissed', 'true');
}
} catch (e) {}`,
},
// <link rel="preconnect" href="https://fonts.googleapis.com">
{
tagName: 'link',
attributes: {
rel: 'preconnect',
href: 'https://fonts.googleapis.com',
},
},
// <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
{
tagName: 'link',
attributes: {
rel: 'preconnect',
href: 'https://fonts.gstatic.com',
crossorigin: 'anonymous',
},
},
{
tagName: 'link',
attributes: {
rel: 'stylesheet',
href: 'https://fonts.googleapis.com/css2?family=Geist:ital,wght@0,300..700;1,300..700&family=Geist+Mono:ital,wght@0,400;0,500;1,400&display=swap',
},
},
],
tagline: description,
favicon: "img/favicon.ico",
url: "https://docs.openrewrite.org",
baseUrl: "/",
organizationName: "openrewrite",
projectName: "rewrite-docs",
deploymentBranch: "docusaurus",
trailingSlash: false,
onBrokenLinks: process.env.CI_STRICT_LINKS ? 'throw' : 'warn',
i18n: {
defaultLocale: "en",
locales: ["en"],
},
scripts: [
{
src: 'reo.js',
}
],
presets: [
[
"classic",
{
docs: {
routeBasePath: "/",
exclude: ['**/_*.{js,jsx,ts,tsx,md,mdx}'],
sidebarCollapsible: true,
sidebarPath: "./sidebars.ts",
editUrl: "https://github.com/openrewrite/rewrite-docs/edit/master",
remarkPlugins: [
[
remarkTokenReplacer,
{
replacements: latestVersions,
},
],
],
},
gtag: {
trackingID: "G-Y67JVX3WB7",
},
theme: {
// Order matters: the design-system tokens define every --mod-* the
// site references, and custom.css is the Infima bridge, so it must
// load second for its --ifm-* mappings to win.
customCss: [
require.resolve("@moderneinc/design-system-tokens/moderne.css"),
"./src/css/custom.css",
],
},
} satisfies Preset.Options,
],
],
markdown: {
hooks: {
onBrokenMarkdownLinks: process.env.CI_STRICT_LINKS ? 'throw' : 'warn',
onBrokenMarkdownImages: process.env.CI_STRICT_LINKS ? 'throw' : 'warn',
}
},
plugins: [
[
'@docusaurus/plugin-client-redirects',
{
redirects: [
{ from: removedChangelogPages, to: '/changelog' },
{ from: removedListPages, to: 'https://codegenomeproject.org/recipes' },
{
from: '/reference/latest-versions-of-every-openrewrite-module',
to: 'https://docs.moderne.io/user-documentation/recipes/lists/latest-versions-of-every-openrewrite-module',
},
// The recipe catalog moved to the Code Genome Project: each recipe page redirects to the
// same recipe there by recipe ID, and each category page to a search on its package. A
// category that mixes vendors (org.openrewrite and io.moderne, say) searches the shared
// part of the package, e.g. `java.spring.boot3`, so no vendor drops out. Recipes that are
// not in the Code Genome Project yet (the python.cleanup recipes and a few staticanalysis
// ones) fall back to their category's search. This file is a snapshot of the catalog's
// last state and is maintained by hand; there is no generator. Inner-class recipe IDs keep a
// literal `$` in `to`: the plugin runs encodeURI on it, so a pre-encoded %24 would become %2524.
...(recipeCatalogRedirects as { from: string | string[]; to: string }[]),
],
},
],
[
'docusaurus-plugin-llms',
{
generateLLMsTxt: true,
generateLLMsFullTxt: false,
generateMarkdownFiles: true,
docsDir: 'docs',
title: 'OpenRewrite Documentation',
description: 'Large-scale automated source code refactoring',
excludeImports: true,
removeDuplicateHeadings: true,
customLLMFiles: [
{
filename: 'llms-getting-started.txt',
includePatterns: ['introduction.md', '**/running-recipes/**/*'],
fullContent: false,
title: 'OpenRewrite Getting Started',
description: 'Introduction and guides for running OpenRewrite recipes',
},
{
filename: 'llms-authoring.txt',
includePatterns: ['**/authoring-recipes/**/*'],
fullContent: false,
title: 'OpenRewrite Recipe Development',
description: 'Guides for creating and testing OpenRewrite recipes',
},
{
filename: 'llms-reference.txt',
includePatterns: ['**/reference/**/*', '**/concepts-and-explanations/**/*'],
fullContent: false,
title: 'OpenRewrite Reference & Concepts',
description: 'Technical reference documentation and core concepts',
},
],
},
],
],
future: {
experimental_faster: true,
v4: true,
},
themeConfig: {
algolia: {
appId: "8XDBE5G3ZV",
apiKey: "14363fc8de10ed3d1785fe6d17a92631",
indexName: "openrewrite",
},
image: "img/moderne-poster-logo.svg",
colorMode: {
respectPrefersColorScheme: true,
},
metadata: [
{
name: 'keywords',
content: 'auto-remediation, Java, migrate, Moderne, OpenRewrite, refactoring, SAST, SCA, Spring Boot Migration, security'
},
],
navbar: {
logo: {
alt: "OpenRewrite Logo",
src: "img/logo.svg",
srcDark: "img/darkLogo.svg",
},
items: [
{
href: "https://github.com/openrewrite",
label: "GitHub",
position: "right",
},
{
href: "https://join.slack.com/t/rewriteoss/shared_invite/zt-nj42n3ea-b~62rIHzb3Vo0E1APKCXEA",
label: "Slack",
position: "right",
},
{
href: "https://discord.gg/xk3ZKrhWAb",
label: "Discord",
position: "right",
},
{
href: "https://docs.moderne.io",
label: "Moderne docs",
position: "right",
},
],
},
// The footer is swizzled (src/theme/Footer), which owns its own links and
// copyright, so there is nothing to configure here.
prism: {
theme: prismThemes.vsDark,
darkTheme: prismThemes.vsDark,
additionalLanguages: [
"bash",
"docker",
"groovy",
"java",
"kotlin",
"yaml",
],
},
} satisfies Preset.ThemeConfig,
};
export default config;