Repository navigation
Expand file tree
/
Copy pathdocusaurus.config.js
More file actions
246 lines (237 loc) · 7.33 KB
/
Copy pathdocusaurus.config.js
File metadata and controls
246 lines (237 loc) · 7.33 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
// @ts-check
// Note: type annotations allow type checking and IDEs autocompletion
const { themes } = require('prism-react-renderer');
const lightCodeTheme = themes.github;
const darkCodeTheme = themes.dracula;
// [item, [[], [], []]]
const apiConfig = require('./dev-docs-openapi.js');
const openApiCongfig = apiConfig.config
const itemsJson = require("./items.json")
const footerItems = require("./footerItems.json")
const logoJson = require('./logo.json')
// Doc files with `unlisted: true` in their frontmatter, relative to docs/.
const unlistedDocs = (function findUnlisted(dir) {
const fs = require('fs');
const path = require('path');
return fs.readdirSync(dir, { withFileTypes: true }).flatMap((entry) => {
const file = path.join(dir, entry.name);
if (entry.isDirectory()) return findUnlisted(file);
if (!/\.mdx?$/.test(entry.name)) return [];
const frontMatter = fs.readFileSync(file, 'utf8').match(/^---\n([\s\S]*?)\n---/);
return frontMatter && /^unlisted:\s*true\b/m.test(frontMatter[1])
? [path.relative('docs', file).split(path.sep).join('/')]
: [];
});
})('docs');
/** @type {import('@docusaurus/types').Config} */
const config = {
scripts: [
{
src: 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/highlight.min.js',
crossorigin: 'anonymous',
}
],
stylesheets: [
{
href: 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.7.0/styles/default.min.css',
},
'src/css/custom.css',
{
href: 'https://cdn.tailwindcss.com/3.4.3'
},
],
title: 'TurboDocx',
tagline: 'Turbocharging your Document Workflows',
url: 'https://docs.turbodocx.com',
baseUrl: '/',
trailingSlash: false,
onBrokenLinks: 'ignore',
markdown: {
hooks: {
onBrokenMarkdownLinks: 'warn',
},
},
favicon: 'img/favicon.ico',
headTags: [
{
tagName: 'script',
attributes: { type: 'application/ld+json' },
innerHTML: JSON.stringify({
'@context': 'https://schema.org',
'@type': 'Organization',
name: 'TurboDocx',
url: 'https://www.turbodocx.com',
logo: 'https://docs.turbodocx.com/img/TurboDocxLogo.png',
}),
},
{
tagName: 'script',
attributes: { type: 'application/ld+json' },
innerHTML: JSON.stringify({
'@context': 'https://schema.org',
'@type': 'WebSite',
name: 'TurboDocx Documentation',
url: 'https://docs.turbodocx.com',
publisher: {
'@type': 'Organization',
name: 'TurboDocx',
},
}),
},
],
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: 'TurboDocx', // Usually your GitHub org/user name.
projectName: 'docusaurus', // Usually your repo name.
plugins: ['docusaurus-plugin-sass',
"@orama/plugin-docusaurus-v3",
[
'@docusaurus/plugin-client-redirects',
{
// "Job Book" was renamed to "Document Package" (BE #1529). The guide's
// filename drives its URL, so without this every previously-shared or
// indexed link to the old page would 404.
redirects: [
{
from: '/docs/Integrations/Wrike/job-books',
to: '/docs/Integrations/Wrike/document-packages',
},
],
},
],
[
'docusaurus-plugin-llms',
{
// Markdown twins: every doc page /<path> also serves /<path>.md, and
// llms.txt links the twins. scripts/agent-markdown.mjs (postbuild) adds
// the frontmatter and rel=alternate links and rebuilds llms-full.txt.
// See AGENTS.md "Every doc page ships a markdown twin".
generateLLMsTxt: true,
generateLLMsFullTxt: false,
generateMarkdownFiles: true,
docsDir: 'docs',
includeBlog: false,
excludeImports: true,
removeDuplicateHeadings: true,
// Unlisted pages are noindex and hidden from the sidebar; a twin or an
// llms.txt entry would expose them. Drafts are skipped by the plugin.
ignoreFiles: unlistedDocs,
}
],
[
'./docusaurus-plugin-indexnow.js',
{
enabled: true,
submitOnBuild: false, // Only submit via CI/CD after deployment
maxUrls: 100
}
],
[
'docusaurus-plugin-openapi-docs',
{
id: "apiDocs",
docsPluginId: "classic",
config: openApiCongfig
},
], async function myPlugin(context, options) {
return {
name: "docusaurus-tailwindcss",
configurePostCss(postcssOptions) {
// Appends TailwindCSS and AutoPrefixer.
postcssOptions.plugins.push(require("tailwindcss"));
postcssOptions.plugins.push(require("autoprefixer"));
return postcssOptions;
},
};
},
],
themes: ["docusaurus-theme-openapi-docs"],
// 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: {
showLastUpdateTime: true,
docItemComponent: "@theme/ApiItem",
sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
// editUrl:
// 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
},
blog: false,
...(process.env.GTM_CONTAINER_ID && {
googleTagManager: {
containerId: process.env.GTM_CONTAINER_ID,
},
}),
theme: {
customCss: require.resolve('./src/css/custom.scss'),
},
sitemap: {
// '/' is a client-side redirect to '/docs' (the real hub) and
// carries a noindex meta tag; exclude it from the sitemap too so
// the two signals don't conflict.
ignorePatterns: ['/'],
},
}),
],
],
themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
image: 'img/turbodocx-og.png',
metadata: [
{ name: 'twitter:site', content: '@turbodocx' },
{ property: 'og:site_name', content: 'TurboDocx Documentation' },
{ property: 'og:type', content: 'website' },
],
colorMode: {
defaultMode: 'dark',
disableSwitch: false,
respectPrefersColorScheme: true,
},
navbar: {
logo: {
alt: 'TurboDocx Logo',
src: 'img/TurboDocxLogo.svg',
href: "https://www.turbodocx.com/?utm_source=docs-site",
},
items: [
...itemsJson.items, {
type: 'search',
position: 'left',
}
],
},
footer: {
style: 'dark',
links: [...footerItems.links],
copyright: `Powered by TurboDocx`,
},
prism: {
theme: lightCodeTheme,
darkTheme: darkCodeTheme,
additionalLanguages: [
'php',
'csharp',
'java',
'python',
'javascript',
'go',
'ruby',
'powershell',
'bash'
],
},
}),
};
module.exports = config;