@heyo-sh/create-heyo-docs 0.2.3 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (67) hide show
  1. package/deployments/cloudflare/astro/package.json +1 -1
  2. package/package.json +1 -1
  3. package/templates/astro/content/api-overview.mdx +20 -0
  4. package/templates/astro/content/assets/local-architecture.svg +22 -0
  5. package/templates/astro/content/assets/quick-reference.txt +5 -0
  6. package/templates/astro/content/changelog.mdx +38 -0
  7. package/templates/astro/content/configuration.mdx +34 -0
  8. package/templates/astro/content/essentials/callouts.mdx +16 -18
  9. package/templates/astro/content/essentials/code-blocks.mdx +7 -15
  10. package/templates/astro/content/essentials/lists.mdx +9 -13
  11. package/templates/astro/content/essentials/tables.mdx +7 -14
  12. package/templates/astro/content/essentials/tabs.mdx +10 -12
  13. package/templates/astro/content/essentials/text-styling.mdx +14 -21
  14. package/templates/astro/content/openapi-petstore.json +160 -0
  15. package/templates/astro/content/openapi.json +278 -0
  16. package/templates/astro/heyo-docs.config.ts +20 -10
  17. package/templates/astro/package.json +1 -1
  18. package/templates/astro/src/components/docs-app.tsx +1 -1
  19. package/templates/astro/src/layouts/docs-layout.astro +494 -8
  20. package/templates/astro/src/pages/[...slug].astro +1 -4
  21. package/templates/astro/src/pages/heyo-docs-internal/ai-chat.ts +20 -0
  22. package/templates/astro/src/pages/index.astro +13 -0
  23. package/templates/astro/src/styles/app.css +12 -2
  24. package/templates/astro/src/virtual.d.ts +7 -0
  25. package/templates/next/app/[[...slug]]/page.tsx +26 -5
  26. package/templates/next/app/app.css +12 -2
  27. package/templates/next/app/components/docs-app.tsx +1 -2
  28. package/templates/next/app/heyo-docs-internal/ai-chat/route.ts +15 -0
  29. package/templates/next/app/layout.tsx +411 -0
  30. package/templates/next/content/api-overview.mdx +20 -0
  31. package/templates/next/content/assets/local-architecture.svg +22 -0
  32. package/templates/next/content/assets/quick-reference.txt +5 -0
  33. package/templates/next/content/changelog.mdx +38 -0
  34. package/templates/next/content/configuration.mdx +34 -0
  35. package/templates/next/content/essentials/callouts.mdx +16 -18
  36. package/templates/next/content/essentials/code-blocks.mdx +7 -15
  37. package/templates/next/content/essentials/lists.mdx +9 -13
  38. package/templates/next/content/essentials/tables.mdx +7 -14
  39. package/templates/next/content/essentials/tabs.mdx +10 -12
  40. package/templates/next/content/essentials/text-styling.mdx +14 -21
  41. package/templates/next/content/openapi-petstore.json +160 -0
  42. package/templates/next/content/openapi.json +278 -0
  43. package/templates/next/heyo-docs.config.ts +20 -10
  44. package/templates/react-router/app/app.css +12 -2
  45. package/templates/react-router/app/root.tsx +412 -1
  46. package/templates/react-router/app/routes/ai-chat.ts +21 -0
  47. package/templates/react-router/app/routes/docs.tsx +1 -1
  48. package/templates/react-router/app/routes/home.tsx +20 -1
  49. package/templates/react-router/app/routes.ts +1 -0
  50. package/templates/react-router/app/virtual.d.ts +7 -0
  51. package/templates/react-router/content/api-overview.mdx +20 -0
  52. package/templates/react-router/content/assets/local-architecture.svg +22 -0
  53. package/templates/react-router/content/assets/quick-reference.txt +5 -0
  54. package/templates/react-router/content/changelog.mdx +38 -0
  55. package/templates/react-router/content/configuration.mdx +34 -0
  56. package/templates/react-router/content/essentials/callouts.mdx +16 -18
  57. package/templates/react-router/content/essentials/code-blocks.mdx +7 -15
  58. package/templates/react-router/content/essentials/lists.mdx +9 -13
  59. package/templates/react-router/content/essentials/tables.mdx +7 -14
  60. package/templates/react-router/content/essentials/tabs.mdx +10 -12
  61. package/templates/react-router/content/essentials/text-styling.mdx +14 -21
  62. package/templates/react-router/content/openapi-petstore.json +160 -0
  63. package/templates/react-router/content/openapi.json +278 -0
  64. package/templates/react-router/heyo-docs.config.ts +20 -10
  65. package/templates/astro/content/index.mdx +0 -22
  66. package/templates/next/content/index.mdx +0 -22
  67. package/templates/react-router/content/index.mdx +0 -22
@@ -1,6 +1,66 @@
1
1
  ---
2
2
  import config from "../../heyo-docs.config";
3
+ import { adobeAnalyticsScript } from "@heyo-sh/heyo-docs/integrations/analytics/adobe";
4
+ import { amplitudeAnalyticsScript } from "@heyo-sh/heyo-docs/integrations/analytics/amplitude";
5
+ import { clarityBootstrapScript } from "@heyo-sh/heyo-docs/integrations/analytics/clarity";
6
+ import { clearbitAnalyticsScript } from "@heyo-sh/heyo-docs/integrations/analytics/clearbit";
7
+ import { fathomAnalyticsScript } from "@heyo-sh/heyo-docs/integrations/analytics/fathom";
8
+ import {
9
+ googleAnalyticsBootstrapScript,
10
+ googleAnalyticsScript,
11
+ } from "@heyo-sh/heyo-docs/integrations/analytics/google-analytics";
12
+ import {
13
+ googleTagManagerBootstrapScript,
14
+ googleTagManagerNoScriptUrl,
15
+ } from "@heyo-sh/heyo-docs/integrations/analytics/google-tag-manager";
16
+ import { heapBootstrapScript } from "@heyo-sh/heyo-docs/integrations/analytics/heap";
17
+ import { hotjarBootstrapScript } from "@heyo-sh/heyo-docs/integrations/analytics/hotjar";
18
+ import {
19
+ logRocketBootstrapScript,
20
+ logRocketScript,
21
+ } from "@heyo-sh/heyo-docs/integrations/analytics/logrocket";
22
+ import {
23
+ mixpanelBootstrapScript,
24
+ mixpanelScript,
25
+ } from "@heyo-sh/heyo-docs/integrations/analytics/mixpanel";
26
+ import {
27
+ openpanelBootstrapScript,
28
+ openpanelScript,
29
+ } from "@heyo-sh/heyo-docs/integrations/analytics/openpanel";
30
+ import { openReplayBootstrapScript } from "@heyo-sh/heyo-docs/integrations/analytics/openreplay";
31
+ import { osanoConsentScript } from "@heyo-sh/heyo-docs/integrations/consent/osano";
32
+ import {
33
+ transcendConsentScript,
34
+ transcendGoogleConsentModeDefaultsScript,
35
+ } from "@heyo-sh/heyo-docs/integrations/consent/transcend";
36
+ import { pirschAnalyticsScript } from "@heyo-sh/heyo-docs/integrations/analytics/pirsch";
37
+ import { plausibleAnalyticsScript } from "@heyo-sh/heyo-docs/integrations/analytics/plausible";
38
+ import {
39
+ posthogApiHost,
40
+ posthogBootstrapScript,
41
+ posthogScript,
42
+ } from "@heyo-sh/heyo-docs/integrations/analytics/posthog";
43
+ import { rybbitAnalyticsScript } from "@heyo-sh/heyo-docs/integrations/analytics/rybbit";
44
+ import {
45
+ swetrixBootstrapScript,
46
+ swetrixScript,
47
+ } from "@heyo-sh/heyo-docs/integrations/analytics/swetrix";
48
+ import { chaskiqBootstrapScript } from "@heyo-sh/heyo-docs/integrations/support/chaskiq";
49
+ import { chatwootBootstrapScript } from "@heyo-sh/heyo-docs/integrations/support/chatwoot";
50
+ import {
51
+ frontChatBootstrapScript,
52
+ frontChatScript,
53
+ } from "@heyo-sh/heyo-docs/integrations/support/front";
54
+ import { intercomBootstrapScript } from "@heyo-sh/heyo-docs/integrations/support/intercom";
55
+ import { papercupsBootstrapScript } from "@heyo-sh/heyo-docs/integrations/support/papercups";
56
+ import { typebotBootstrapScript } from "@heyo-sh/heyo-docs/integrations/support/typebot";
57
+ import { umamiAnalyticsScript } from "@heyo-sh/heyo-docs/integrations/analytics/umami";
58
+ import {
59
+ zammadBootstrapScript,
60
+ zammadChatScript,
61
+ } from "@heyo-sh/heyo-docs/integrations/support/zammad";
3
62
  import "../styles/app.css";
63
+ import "virtual:heyo-docs-theme.css";
4
64
  import { getThemeScript, THEME_STORAGE_KEY } from "../lib/theme";
5
65
 
6
66
  interface Props {
@@ -20,11 +80,128 @@ const {
20
80
  } = Astro.props;
21
81
  const jsonLd = JSON.stringify(structuredData).replace(/</g, "\\u003c");
22
82
  const hasChangelog = config.groups.some((group) => group.type === "changelog");
83
+ const osano = config.integrations.consent.osano
84
+ ? osanoConsentScript(config.integrations.consent.osano)
85
+ : undefined;
86
+ const transcend = config.integrations.consent.transcend
87
+ ? transcendConsentScript(config.integrations.consent.transcend)
88
+ : undefined;
89
+ const transcendGoogleConsentDefaults =
90
+ transcend &&
91
+ (config.integrations.analytics.ga4 || config.integrations.analytics.gtm)
92
+ ? transcendGoogleConsentModeDefaultsScript()
93
+ : undefined;
94
+ const adobe = config.integrations.analytics.adobe
95
+ ? adobeAnalyticsScript(config.integrations.analytics.adobe)
96
+ : undefined;
97
+ const amplitude = config.integrations.analytics.amplitude
98
+ ? amplitudeAnalyticsScript(config.integrations.analytics.amplitude)
99
+ : undefined;
100
+ const clarity = config.integrations.analytics.clarity
101
+ ? clarityBootstrapScript()
102
+ : undefined;
103
+ const clearbit = config.integrations.analytics.clearbit
104
+ ? clearbitAnalyticsScript(config.integrations.analytics.clearbit)
105
+ : undefined;
106
+ const fathom = config.integrations.analytics.fathom
107
+ ? fathomAnalyticsScript(config.integrations.analytics.fathom)
108
+ : undefined;
109
+ const googleAnalytics = config.integrations.analytics.ga4
110
+ ? googleAnalyticsScript(config.integrations.analytics.ga4)
111
+ : undefined;
112
+ const googleAnalyticsBootstrap = googleAnalytics
113
+ ? googleAnalyticsBootstrapScript()
114
+ : undefined;
115
+ const googleTagManager = config.integrations.analytics.gtm
116
+ ? googleTagManagerBootstrapScript()
117
+ : undefined;
118
+ const googleTagManagerNoScript = config.integrations.analytics.gtm
119
+ ? googleTagManagerNoScriptUrl(config.integrations.analytics.gtm)
120
+ : undefined;
121
+ const heap = config.integrations.analytics.heap
122
+ ? heapBootstrapScript()
123
+ : undefined;
124
+ const hotjar = config.integrations.analytics.hotjar
125
+ ? hotjarBootstrapScript()
126
+ : undefined;
127
+ const logRocket = config.integrations.analytics.logrocket
128
+ ? logRocketScript()
129
+ : undefined;
130
+ const logRocketBootstrap = logRocket ? logRocketBootstrapScript() : undefined;
131
+ const mixpanel = config.integrations.analytics.mixpanel
132
+ ? mixpanelScript()
133
+ : undefined;
134
+ const mixpanelBootstrap = mixpanel ? mixpanelBootstrapScript() : undefined;
135
+ const openpanel = config.integrations.analytics.openpanel
136
+ ? openpanelScript()
137
+ : undefined;
138
+ const openpanelBootstrap = openpanel ? openpanelBootstrapScript() : undefined;
139
+ const openReplay = config.integrations.analytics.openreplay
140
+ ? openReplayBootstrapScript()
141
+ : undefined;
142
+ const pirsch = config.integrations.analytics.pirsch
143
+ ? pirschAnalyticsScript(config.integrations.analytics.pirsch)
144
+ : undefined;
145
+ const plausible = config.integrations.analytics.plausible
146
+ ? plausibleAnalyticsScript(config.integrations.analytics.plausible)
147
+ : undefined;
148
+ const posthog = config.integrations.analytics.posthog
149
+ ? posthogScript(config.integrations.analytics.posthog)
150
+ : undefined;
151
+ const posthogBootstrap = posthog ? posthogBootstrapScript() : undefined;
152
+ const posthogHost = config.integrations.analytics.posthog
153
+ ? posthogApiHost(config.integrations.analytics.posthog)
154
+ : undefined;
155
+ const rybbit = config.integrations.analytics.rybbit
156
+ ? rybbitAnalyticsScript(config.integrations.analytics.rybbit)
157
+ : undefined;
158
+ const swetrix = config.integrations.analytics.swetrix
159
+ ? swetrixScript()
160
+ : undefined;
161
+ const swetrixBootstrap = swetrix ? swetrixBootstrapScript() : undefined;
162
+ const umami = config.integrations.analytics.umami
163
+ ? umamiAnalyticsScript(config.integrations.analytics.umami)
164
+ : undefined;
165
+ const intercom = config.integrations.support.intercom
166
+ ? intercomBootstrapScript()
167
+ : undefined;
168
+ const front = config.integrations.support.front ? frontChatScript() : undefined;
169
+ const frontBootstrap = front ? frontChatBootstrapScript() : undefined;
170
+ const chatwoot = config.integrations.support.chatwoot
171
+ ? chatwootBootstrapScript()
172
+ : undefined;
173
+ const chaskiq = config.integrations.support.chaskiq
174
+ ? chaskiqBootstrapScript()
175
+ : undefined;
176
+ const papercups = config.integrations.support.papercups
177
+ ? papercupsBootstrapScript()
178
+ : undefined;
179
+ const typebot = config.integrations.support.typebot
180
+ ? typebotBootstrapScript()
181
+ : undefined;
182
+ const zammad = config.integrations.support.zammad
183
+ ? zammadChatScript(config.integrations.support.zammad)
184
+ : undefined;
185
+ const zammadBootstrap = zammad ? zammadBootstrapScript() : undefined;
23
186
  ---
24
187
 
25
188
  <!doctype html>
26
189
  <html lang="en">
27
190
  <head>
191
+ {
192
+ transcendGoogleConsentDefaults && (
193
+ <script is:inline set:html={transcendGoogleConsentDefaults} />
194
+ )
195
+ }
196
+ {
197
+ transcend && (
198
+ <script
199
+ is:inline
200
+ data-cfasync={transcend.dataCfasync}
201
+ src={transcend.src}
202
+ />
203
+ )
204
+ }
28
205
  <meta charset="utf-8" />
29
206
  <meta name="viewport" content="width=device-width, initial-scale=1" />
30
207
  <meta name="color-scheme" content="light dark" />
@@ -43,12 +220,7 @@ const hasChangelog = config.groups.some((group) => group.type === "changelog");
43
220
  {canonical && <meta property="og:url" content={canonical} />}
44
221
  <link rel="icon" href="/favicon.ico" sizes="any" />
45
222
  <link rel="icon" href="/favicon.svg" type="image/svg+xml" />
46
- <link
47
- rel="icon"
48
- href="/favicon-96x96.png"
49
- sizes="96x96"
50
- type="image/png"
51
- />
223
+ <link rel="icon" href="/favicon-96x96.png" sizes="96x96" type="image/png" />
52
224
  <link rel="apple-touch-icon" href="/apple-touch-icon.png" sizes="180x180" />
53
225
  <link rel="manifest" href="/site.webmanifest" />
54
226
  {
@@ -61,10 +233,324 @@ const hasChangelog = config.groups.some((group) => group.type === "changelog");
61
233
  />
62
234
  )
63
235
  }
64
- <script is:inline set:html={getThemeScript(THEME_STORAGE_KEY, config.mode)}></script>
65
- <script is:inline type="application/ld+json" set:html={jsonLd}></script>
236
+ {osano && <script is:inline src={osano.src} />}
237
+ {
238
+ googleTagManager && (
239
+ <script
240
+ is:inline
241
+ data-google-tag-manager-container-id={
242
+ config.integrations.analytics.gtm?.containerId
243
+ }
244
+ set:html={googleTagManager}
245
+ />
246
+ )
247
+ }
248
+ <script
249
+ is:inline
250
+ set:html={getThemeScript(THEME_STORAGE_KEY, config.mode)}
251
+ />
252
+ {adobe && <script is:inline async src={adobe.src} />}
253
+ {amplitude && <script is:inline src={amplitude.src} />}
254
+ {
255
+ clarity && (
256
+ <script
257
+ is:inline
258
+ data-clarity-project-id={
259
+ config.integrations.analytics.clarity?.projectId
260
+ }
261
+ set:html={clarity}
262
+ />
263
+ )
264
+ }
265
+ {clearbit && <script is:inline src={clearbit.src} />}
266
+ {
267
+ fathom && (
268
+ <script
269
+ is:inline
270
+ data-site={fathom.siteId}
271
+ data-spa={fathom.spa}
272
+ defer={fathom.defer}
273
+ src={fathom.src}
274
+ />
275
+ )
276
+ }
277
+ {
278
+ googleAnalytics && googleAnalyticsBootstrap && (
279
+ <>
280
+ <script
281
+ is:inline
282
+ async={googleAnalytics.async}
283
+ src={googleAnalytics.src}
284
+ />
285
+ <script
286
+ is:inline
287
+ data-google-analytics-measurement-id={
288
+ config.integrations.analytics.ga4?.measurementId
289
+ }
290
+ set:html={googleAnalyticsBootstrap}
291
+ />
292
+ </>
293
+ )
294
+ }
295
+ {
296
+ heap && (
297
+ <script
298
+ is:inline
299
+ data-heap-environment-id={
300
+ config.integrations.analytics.heap?.environmentId
301
+ }
302
+ set:html={heap}
303
+ />
304
+ )
305
+ }
306
+ {
307
+ hotjar && (
308
+ <script
309
+ is:inline
310
+ data-hotjar-site-id={config.integrations.analytics.hotjar?.siteId}
311
+ data-hotjar-snippet-version={
312
+ config.integrations.analytics.hotjar?.snippetVersion
313
+ }
314
+ set:html={hotjar}
315
+ />
316
+ )
317
+ }
318
+ {
319
+ logRocket && logRocketBootstrap && (
320
+ <>
321
+ <script
322
+ is:inline
323
+ crossorigin={logRocket.crossOrigin}
324
+ src={logRocket.src}
325
+ />
326
+ <script
327
+ is:inline
328
+ data-logrocket-app-id={
329
+ config.integrations.analytics.logrocket?.appId
330
+ }
331
+ set:html={logRocketBootstrap}
332
+ />
333
+ </>
334
+ )
335
+ }
336
+ {
337
+ mixpanel && mixpanelBootstrap && (
338
+ <>
339
+ <script is:inline src={mixpanel.src} />
340
+ <script
341
+ is:inline
342
+ data-mixpanel-project-token={
343
+ config.integrations.analytics.mixpanel?.projectToken
344
+ }
345
+ set:html={mixpanelBootstrap}
346
+ />
347
+ </>
348
+ )
349
+ }
350
+ {
351
+ openpanel && openpanelBootstrap && (
352
+ <>
353
+ <script
354
+ is:inline
355
+ data-openpanel-api-url={
356
+ config.integrations.analytics.openpanel?.apiUrl
357
+ }
358
+ data-openpanel-client-id={
359
+ config.integrations.analytics.openpanel?.clientId
360
+ }
361
+ set:html={openpanelBootstrap}
362
+ />
363
+ <script
364
+ is:inline
365
+ async={openpanel.async}
366
+ defer={openpanel.defer}
367
+ src={openpanel.src}
368
+ />
369
+ </>
370
+ )
371
+ }
372
+ {
373
+ openReplay && (
374
+ <script
375
+ is:inline
376
+ data-openreplay-ingest-point={
377
+ config.integrations.analytics.openreplay?.ingestPoint
378
+ }
379
+ data-openreplay-project-key={
380
+ config.integrations.analytics.openreplay?.projectKey
381
+ }
382
+ set:html={openReplay}
383
+ />
384
+ )
385
+ }
386
+ {
387
+ pirsch && (
388
+ <script
389
+ is:inline
390
+ data-code={pirsch.code}
391
+ defer={pirsch.defer}
392
+ src={pirsch.src}
393
+ />
394
+ )
395
+ }
396
+ {
397
+ plausible && (
398
+ <script
399
+ is:inline
400
+ data-domain={plausible.domain}
401
+ defer={plausible.defer}
402
+ src={plausible.src}
403
+ />
404
+ )
405
+ }
406
+ {
407
+ posthog && posthogBootstrap && posthogHost && (
408
+ <>
409
+ <script is:inline src={posthog.src} />
410
+ <script
411
+ is:inline
412
+ data-posthog-api-host={posthogHost}
413
+ data-posthog-project-api-key={
414
+ config.integrations.analytics.posthog?.projectApiKey
415
+ }
416
+ set:html={posthogBootstrap}
417
+ />
418
+ </>
419
+ )
420
+ }
421
+ {
422
+ rybbit && (
423
+ <script
424
+ is:inline
425
+ data-site-id={rybbit.siteId}
426
+ defer={rybbit.defer}
427
+ src={rybbit.src}
428
+ />
429
+ )
430
+ }
431
+ {
432
+ umami && (
433
+ <script
434
+ is:inline
435
+ data-website-id={umami.websiteId}
436
+ defer={umami.defer}
437
+ src={umami.src}
438
+ />
439
+ )
440
+ }
441
+ {
442
+ chaskiq && (
443
+ <script
444
+ is:inline
445
+ data-chaskiq-app-id={config.integrations.support.chaskiq?.appId}
446
+ data-chaskiq-base-url={config.integrations.support.chaskiq?.baseUrl}
447
+ data-chaskiq-ws-url={config.integrations.support.chaskiq?.wsUrl}
448
+ set:html={chaskiq}
449
+ />
450
+ )
451
+ }
452
+ {
453
+ papercups && (
454
+ <script
455
+ is:inline
456
+ data-papercups-base-url={
457
+ config.integrations.support.papercups?.baseUrl
458
+ }
459
+ data-papercups-inbox={config.integrations.support.papercups?.inbox}
460
+ data-papercups-token={config.integrations.support.papercups?.token}
461
+ set:html={papercups}
462
+ />
463
+ )
464
+ }
465
+ {
466
+ typebot && (
467
+ <script
468
+ is:inline
469
+ data-heyo-typebot
470
+ data-typebot-api-host={config.integrations.support.typebot?.apiHost}
471
+ data-typebot-id={config.integrations.support.typebot?.typebot}
472
+ set:html={typebot}
473
+ type="module"
474
+ />
475
+ )
476
+ }
477
+ <script is:inline type="application/ld+json" set:html={jsonLd} />
66
478
  </head>
67
479
  <body>
480
+ {
481
+ googleTagManagerNoScript && (
482
+ <noscript>
483
+ <iframe
484
+ height="0"
485
+ src={googleTagManagerNoScript}
486
+ style="display:none;visibility:hidden"
487
+ title="Google Tag Manager"
488
+ width="0"
489
+ />
490
+ </noscript>
491
+ )
492
+ }
68
493
  <slot />
494
+ {
495
+ swetrix && swetrixBootstrap && (
496
+ <>
497
+ <script is:inline defer={swetrix.defer} src={swetrix.src} />
498
+ <script
499
+ is:inline
500
+ data-swetrix-api-url={config.integrations.analytics.swetrix?.apiUrl}
501
+ data-swetrix-project-id={
502
+ config.integrations.analytics.swetrix?.projectId
503
+ }
504
+ set:html={swetrixBootstrap}
505
+ />
506
+ </>
507
+ )
508
+ }
509
+ {
510
+ intercom && (
511
+ <script
512
+ is:inline
513
+ data-intercom-app-id={config.integrations.support.intercom?.appId}
514
+ data-intercom-api-base={config.integrations.support.intercom?.apiBase}
515
+ set:html={intercom}
516
+ />
517
+ )
518
+ }
519
+ {
520
+ front && frontBootstrap && (
521
+ <>
522
+ <script is:inline src={front.src} />
523
+ <script
524
+ is:inline
525
+ data-front-chat-id={config.integrations.support.front?.chatId}
526
+ set:html={frontBootstrap}
527
+ />
528
+ </>
529
+ )
530
+ }
531
+ {
532
+ chatwoot && (
533
+ <script
534
+ is:inline
535
+ data-chatwoot-base-url={config.integrations.support.chatwoot?.baseUrl}
536
+ data-chatwoot-website-token={
537
+ config.integrations.support.chatwoot?.websiteToken
538
+ }
539
+ set:html={chatwoot}
540
+ />
541
+ )
542
+ }
543
+ {
544
+ zammad && zammadBootstrap && (
545
+ <>
546
+ <script is:inline src={zammad.src} />
547
+ <script
548
+ is:inline
549
+ data-zammad-chat-id={config.integrations.support.zammad?.chatId}
550
+ set:html={zammadBootstrap}
551
+ />
552
+ </>
553
+ )
554
+ }
69
555
  </body>
70
556
  </html>
@@ -38,10 +38,7 @@ const seo = exists
38
38
  };
39
39
  ---
40
40
 
41
- <DocsLayout
42
- {...seo}
43
- robots={exists ? "index, follow" : "noindex"}
44
- >
41
+ <DocsLayout {...seo} robots={exists ? "index, follow" : "noindex"}>
45
42
  <AstroDocsApp
46
43
  client:load
47
44
  currentOpenApiEndpoint={currentOpenApiEndpoint}
@@ -0,0 +1,20 @@
1
+ import { createAiChatResponse } from "@heyo-sh/heyo-docs/ai";
2
+ import type { APIRoute } from "astro";
3
+
4
+ import config from "../../../heyo-docs.config";
5
+ import { pages as markdownPages } from "virtual:heyo-docs-content/server";
6
+
7
+ export const prerender = false;
8
+
9
+ export const POST: APIRoute = ({ request }) =>
10
+ createAiChatResponse(request, {
11
+ ai: config.ai,
12
+ markdownPages,
13
+ pages: markdownPages.map((page) => ({
14
+ description: page.description,
15
+ searchContent: page.raw,
16
+ slug: page.slug,
17
+ title: page.title,
18
+ })),
19
+ title: config.title,
20
+ });
@@ -0,0 +1,13 @@
1
+ ---
2
+ import { navigationPages } from "@heyo-sh/heyo-docs";
3
+
4
+ import { docsContext } from "../lib/docs";
5
+
6
+ const firstPage = docsContext("/")
7
+ .model.navigation.flatMap((group) => navigationPages(group.sections))
8
+ .at(0);
9
+
10
+ if (!firstPage) throw new Error("No local documentation page is configured.");
11
+
12
+ return Astro.redirect(firstPage.slug);
13
+ ---
@@ -1,8 +1,18 @@
1
1
  @import "@fontsource-variable/figtree";
2
- @import "@heyo-sh/heyo-docs/theme/{{THEME}}.css";
3
2
 
4
3
  :root {
5
4
  --heyo-docs-font-family: "Figtree Variable", sans-serif;
6
5
  }
7
6
 
8
- /* Add project-specific token overrides and theme styles below this import. */
7
+ /* Add project-specific token overrides and theme styles here. */
8
+ @media (min-width: 1024px) {
9
+ header > a[aria-label] > img[src="/logo.svg"] {
10
+ height: 32px;
11
+ max-height: none;
12
+ width: auto;
13
+ }
14
+ }
15
+
16
+ .dark header > a[aria-label] > img[src="/logo.svg"] {
17
+ filter: invert(1);
18
+ }
@@ -3,6 +3,13 @@ declare module "virtual:heyo-docs-content" {
3
3
  export const pages: DocsPage[];
4
4
  }
5
5
 
6
+ declare module "virtual:heyo-docs-config" {
7
+ import type { HeyoDocsConfig } from "@heyo-sh/heyo-docs";
8
+ export const config: HeyoDocsConfig;
9
+ }
10
+
11
+ declare module "virtual:heyo-docs-theme.css";
12
+
6
13
  declare module "virtual:heyo-docs-content/server" {
7
14
  import type { MarkdownPage } from "@heyo-sh/heyo-docs";
8
15
  export const pages: MarkdownPage[];
@@ -1,6 +1,9 @@
1
1
  import type { Metadata } from "next";
2
- import { notFound } from "next/navigation";
3
- import { openApiEndpointDetail } from "@heyo-sh/heyo-docs/node";
2
+ import { notFound, redirect } from "next/navigation";
3
+ import {
4
+ navigationPages,
5
+ openApiEndpointDetail,
6
+ } from "@heyo-sh/heyo-docs/node";
4
7
 
5
8
  import { NextDocsApp } from "../components/docs-app";
6
9
  import { docsContext, docsModel, pathnameForSegments } from "../lib/docs";
@@ -14,9 +17,12 @@ interface PageProps {
14
17
  export const dynamic = "force-static";
15
18
 
16
19
  export async function generateStaticParams() {
17
- return [...docsModel.pages, ...docsModel.endpoints].map(({ slug }) => ({
18
- slug: slug === "/" ? [] : slug.slice(1).split("/"),
19
- }));
20
+ return [
21
+ { slug: [] },
22
+ ...[...docsModel.pages, ...docsModel.endpoints].map(({ slug }) => ({
23
+ slug: slug.slice(1).split("/"),
24
+ })),
25
+ ];
20
26
  }
21
27
 
22
28
  export async function generateMetadata({
@@ -25,6 +31,11 @@ export async function generateMetadata({
25
31
  const { slug } = await params;
26
32
  const pathname = pathnameForSegments(slug);
27
33
  const context = docsContext(pathname);
34
+ if (pathname === "/")
35
+ return {
36
+ title: context.config.title,
37
+ robots: { index: false, follow: false },
38
+ };
28
39
  if (!context.page && !context.endpoint)
29
40
  return {
30
41
  title: `Not found | ${context.config.title}`,
@@ -36,6 +47,16 @@ export async function generateMetadata({
36
47
  export default async function DocsPage({ params }: PageProps) {
37
48
  const { slug } = await params;
38
49
  const pathname = pathnameForSegments(slug);
50
+ if (pathname === "/") {
51
+ const firstPage = docsModel.navigation
52
+ .flatMap((group) => navigationPages(group.sections))
53
+ .at(0);
54
+
55
+ if (!firstPage)
56
+ throw new Error("No local documentation page is configured.");
57
+
58
+ redirect(firstPage.slug);
59
+ }
39
60
  const context = docsContext(pathname);
40
61
  if (!context.page && !context.endpoint) notFound();
41
62
  const { structuredData } = docsSeo({ ...context, pathname });
@@ -1,8 +1,18 @@
1
1
  @import "@fontsource-variable/figtree";
2
- @import "@heyo-sh/heyo-docs/theme/{{THEME}}.css";
3
2
 
4
3
  :root {
5
4
  --heyo-docs-font-family: "Figtree Variable", sans-serif;
6
5
  }
7
6
 
8
- /* Add project-specific token overrides and theme styles below this import. */
7
+ /* Add project-specific token overrides and theme styles here. */
8
+ @media (min-width: 1024px) {
9
+ header > a[aria-label] > img[src="/logo.svg"] {
10
+ height: 32px;
11
+ max-height: none;
12
+ width: auto;
13
+ }
14
+ }
15
+
16
+ .dark header > a[aria-label] > img[src="/logo.svg"] {
17
+ filter: invert(1);
18
+ }