forked from RasaHQ/rasa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocusaurus.config.js
180 lines (173 loc) · 5.45 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
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
const path = require('path');
const { remarkProgramOutput } = require('./plugins/program_output');
const {
rehypePlugins: themeRehypePlugins,
remarkPlugins: themeRemarkPlugins,
} = require('@rasahq/docusaurus-theme-tabula');
const isDev = process.env.NODE_ENV === 'development';
const isStaging = process.env.NETLIFY && process.env.CONTEXT === 'staging';
const isPreview = process.env.NETLIFY && process.env.CONTEXT === 'deploy-preview';
const BASE_URL = '/docs/rasa/';
const SITE_URL = 'https://rasa.com';
// NOTE: this allows switching between local dev instances of rasa/rasa-enterprise
const SWAP_URL = isDev ? 'http://localhost:3001' : SITE_URL;
let existingVersions = [];
try { existingVersions = require('./versions.json'); } catch (e) { console.info('no versions.json file found') }
const routeBasePath = '/';
const versionLabels = {
current: 'Main/Unreleased'
};
module.exports = {
customFields: {
// FIXME: this is a simplistic solution to https://github.com/RasaHQ/rasa/issues/7011
// either (A): create a more sophisticated solution to link the precise branch and doc to be edited, according to branch settings
// or (B): create a README document (or a section in the main README) which explains how to contribute docs fixes, and link all edit links to this
rootEditUrl: 'https://github.com/rasahq/rasa/',
productLogo: '/img/blocks.png',
versionLabels,
legacyVersions: [{
label: 'Legacy 1.x',
href: 'https://legacy-docs-v1.rasa.com',
target: '_blank',
rel: 'nofollow noopener noreferrer',
}],
redocPages: [
{
title: 'Rasa HTTP API',
specUrl: '/spec/rasa.yml',
slug: '/pages/http-api',
},
{
title: 'Rasa Action Server API',
specUrl: '/spec/action-server.yml',
slug: '/pages/action-server-api',
}
]
},
title: 'Rasa & Rasa Pro Documentation',
url: SITE_URL,
baseUrl: BASE_URL,
favicon: '/img/favicon.ico',
organizationName: 'RasaHQ',
projectName: 'rasa',
themeConfig: {
announcementBar: {
id: 'rasa_sdk_change', // Any value that will identify this message.
content: '<strong>Rasa SDK<strong> documentation has been moved to a <a href="https://rasa.com/docs/rasa/action-server/">section</a> of <strong>Rasa Open Source</strong>.',
backgroundColor: '#6200F5', // Defaults to `#fff`.
textColor: '#fff', // Defaults to `#000`.
// isCloseable: false, // Defaults to `true`.
},
algolia: {
appId: '94J0KRFPTZ',
apiKey: '75ea5a8c8f4b16405c560a4ba786256b',
indexName: 'rasa',
inputSelector: '.search-bar',
},
navbar: {
hideOnScroll: false,
title: 'Rasa',
items: [
{
label: 'Rasa',
to: path.join('/', BASE_URL),
position: 'left',
},
{
target: '_self',
label: 'Rasa X/Enterprise',
position: 'left',
href: `${SWAP_URL}/docs/rasa-enterprise/`,
},
{
href: 'https://github.com/rasahq/rasa',
className: 'header-github-link',
'aria-label': 'GitHub repository',
position: 'right',
},
{
target: '_self',
href: 'https://blog.rasa.com/',
label: 'Blog',
position: 'right',
},
{
label: 'Community',
position: 'right',
items: [
{
target: '_self',
href: 'https://rasa.com/community/join/',
label: 'Community Hub',
},
{
target: '_self',
href: 'https://forum.rasa.com',
label: 'Forum',
},
{
target: '_self',
href: 'https://rasa.com/community/contribute/',
label: 'How to Contribute',
},
{
target: '_self',
href: 'https://rasa.com/showcase/',
label: 'Community Showcase',
},
],
},
],
},
footer: {
copyright: `Copyright © ${new Date().getFullYear()} Rasa Technologies GmbH`,
},
gtm: {
containerID: 'GTM-MMHSZCS',
},
},
themes: [
'@docusaurus/theme-search-algolia',
'@rasahq/docusaurus-theme-tabula',
path.resolve(__dirname, './themes/theme-custom')
],
plugins: [
['@docusaurus/plugin-content-docs/', {
routeBasePath,
sidebarPath: require.resolve('./sidebars.js'),
editUrl: 'https://github.com/rasahq/rasa/edit/main/docs/',
showLastUpdateTime: true,
showLastUpdateAuthor: true,
rehypePlugins: [
...themeRehypePlugins,
],
remarkPlugins: [
...themeRemarkPlugins,
remarkProgramOutput,
],
lastVersion: existingVersions[0] || 'current', // aligns / to last versioned folder in production
versions: {
current: {
label: versionLabels['current'],
path: existingVersions.length < 1 ? '' : 'next',
},
},
}],
['@docusaurus/plugin-content-pages', {}],
[
'@docusaurus/plugin-ideal-image',
{
sizes: [160, 226, 320, 452, 640, 906, 1280, 1810, 2560],
quality: 70,
},
],
['@docusaurus/plugin-sitemap',
{
cacheTime: 600 * 1000, // 600 sec - cache purge period
changefreq: 'weekly',
priority: 0.5,
}],
isDev && ['@docusaurus/plugin-debug', {}],
[path.resolve(__dirname, './plugins/google-tagmanager'), {}],
].filter(Boolean),
};