Skip to content

Commit f27baaa

Browse files
Add Kapa AI Widget with no theme controls (#1898)
* Add Kapa AI Widget with no theme controls * fix editor config to prevent format spam * added next doc key for kapa * disable kapa button * Unhide button * Fine-tune button & modal look & feel * Update style * Add disclaimer and reference link --------- Co-authored-by: Pierre Wizla <[email protected]> Co-authored-by: Pierre Wizla <[email protected]>
1 parent 29f328f commit f27baaa

File tree

5 files changed

+41
-22
lines changed

5 files changed

+41
-22
lines changed

.editorconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@ end_of_line = lf
77
charset = utf-8
88
trim_trailing_whitespace = true
99
insert_final_newline = true
10+
quote_type = single
1011

1112
[{package.json,*.yml}]
1213
indent_style = space
1314
indent_size = 2
1415

1516
[*.md]
16-
trim_trailing_whitespace = false
17+
trim_trailing_whitespace = false

docusaurus/docusaurus.config.js

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -30,38 +30,32 @@ const config = {
3030

3131
scripts: [
3232
{
33-
src:
34-
'/js/hotjar.js',
33+
src: '/js/hotjar.js',
3534
type: 'module',
3635
async: true,
3736
},
3837
{
39-
src:
40-
'/js/particle.js',
38+
src: '/js/particle.js',
4139
type: 'module',
4240
async: true,
4341
},
4442
{
45-
src:
46-
'/js/firework.js',
43+
src: '/js/firework.js',
4744
type: 'module',
4845
async: true,
4946
},
5047
{
51-
src:
52-
'/js/ball.js',
48+
src: '/js/ball.js',
5349
type: 'module',
5450
async: true,
5551
},
5652
{
57-
src:
58-
'/js/bar.js',
53+
src: '/js/bar.js',
5954
type: 'module',
6055
async: true,
6156
},
6257
{
63-
src:
64-
'/js/game.js',
58+
src: '/js/game.js',
6559
type: 'module',
6660
async: true,
6761
},
@@ -70,6 +64,21 @@ const config = {
7064
type: 'module',
7165
async: true,
7266
},
67+
{
68+
/**
69+
* Kapa AI widget script and parameters
70+
* See https://docs.kapa.ai/installation-widget#optional-configuration-parameters-
71+
*/
72+
src: 'https://widget.kapa.ai/kapa-widget.bundle.js',
73+
'data-website-id': 'f1838a12-ad58-4224-9fab-2f0704eeeb52',
74+
'data-project-name': 'Strapi',
75+
'data-project-logo': 'https://strapi.io/assets/favicon-32x32.png',
76+
// 'data-button-hide': 'true',
77+
'data-modal-disclaimer': 'Answers are AI-generated and might be inaccurate. Please ensure you double-check the information provided by visiting source pages.',
78+
'data-project-color': '#4945FF',
79+
'data-button-bg-color': '#32324D',
80+
async: true,
81+
},
7382
],
7483
presets: [
7584
[
@@ -120,7 +129,7 @@ const config = {
120129
specs: [
121130
{
122131
spec: 'docs/dev-docs/api/openapi.yaml',
123-
route: '/openapi/'
132+
route: '/openapi/',
124133
},
125134
],
126135
// Theme Options for modifying how redoc renders them
@@ -136,11 +145,12 @@ const config = {
136145
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
137146
({
138147
announcementBar: {
139-
id: 'support_us',
140-
content: "You're reading a work-in-progress documentation for the upcoming Strapi v5. <a target='_blank' rel='noopener noreferrer' href='#'>We'd love to read your feedback!</a> Looking for the stable v4 docs? Please visit <a href='https://docs.strapi.io'>docs.strapi.io</a>.",
141-
backgroundColor: '#F3E5FA',
142-
textColor: '#091E42',
143-
isCloseable: true,
148+
id: 'support_us',
149+
content:
150+
"You're reading a work-in-progress documentation for the upcoming Strapi v5. <a target='_blank' rel='noopener noreferrer' href='#'>We'd love to read your feedback!</a> Looking for the stable v4 docs? Please visit <a href='https://docs.strapi.io'>docs.strapi.io</a>.",
151+
backgroundColor: '#F3E5FA',
152+
textColor: '#091E42',
153+
isCloseable: true,
144154
},
145155
docs: {
146156
sidebar: {
@@ -171,13 +181,13 @@ const config = {
171181
type: 'doc',
172182
docId: 'user-docs/intro',
173183
position: 'left',
174-
label: 'User Guide'
184+
label: 'User Guide',
175185
},
176186
{
177187
type: 'doc',
178188
docId: 'cloud/getting-started/intro',
179189
position: 'left',
180-
label: 'Strapi Cloud'
190+
label: 'Strapi Cloud',
181191
},
182192
{
183193
href: 'https://github.com/strapi/documentation',
@@ -252,7 +262,7 @@ const config = {
252262
{
253263
label: 'Strapi.io',
254264
href: 'https://strapi.io',
255-
}
265+
},
256266
],
257267
},
258268
],

docusaurus/src/scss/__index.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,4 @@
3939
@import 'tabs.scss';
4040
@import 'table-of-contents.scss';
4141
@import 'typography.scss';
42+
@import 'kapa.scss';

docusaurus/src/scss/kapa.scss

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
/** Styles for the Kapa AI generated components
2+
* Some styles are directly set up in docusaurus.config.js,
3+
* but some are not possible to set up there, so they are here.
4+
*/
5+
.mantine-InputWrapper-root button:hover {
6+
background-color: #7B79FF;
7+
}

docusaurus/static/img/strapi-logo.png

16.8 KB
Loading

0 commit comments

Comments
 (0)