docus 5.6.1 → 5.8.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 (74) hide show
  1. package/app/app.vue +13 -1
  2. package/app/assets/icons/LICENSE +14 -0
  3. package/app/assets/icons/ai.svg +1 -0
  4. package/app/components/LanguageSelect.vue +1 -4
  5. package/app/components/OgImage/OgImageDocs.vue +2 -4
  6. package/app/components/OgImage/OgImageLanding.vue +36 -13
  7. package/app/components/app/AppFooterRight.vue +32 -14
  8. package/app/components/app/AppHeader.vue +10 -0
  9. package/app/components/app/AppHeaderBottom.vue +20 -0
  10. package/app/components/app/AppHeaderBottomRight.vue +3 -0
  11. package/app/components/docs/DocsAsideLeftBody.vue +2 -4
  12. package/app/components/docs/DocsAsideLeftTop.vue +18 -1
  13. package/app/components/docs/DocsAsideMobileBar.vue +88 -0
  14. package/app/components/docs/DocsAsideRight.vue +33 -0
  15. package/app/components/docs/DocsAsideRightBottom.vue +1 -1
  16. package/app/composables/useDocusI18n.ts +21 -5
  17. package/app/composables/useLogoAssets.ts +1 -1
  18. package/app/composables/useSubNavigation.ts +55 -0
  19. package/app/pages/[[lang]]/[...slug].vue +4 -13
  20. package/i18n/locales/ar.json +1 -0
  21. package/i18n/locales/be.json +1 -0
  22. package/i18n/locales/bg.json +1 -0
  23. package/i18n/locales/bn.json +1 -0
  24. package/i18n/locales/ca.json +1 -0
  25. package/i18n/locales/ckb.json +1 -0
  26. package/i18n/locales/cs.json +1 -0
  27. package/i18n/locales/da.json +1 -0
  28. package/i18n/locales/de.json +1 -0
  29. package/i18n/locales/el.json +1 -0
  30. package/i18n/locales/en.json +1 -0
  31. package/i18n/locales/es.json +1 -0
  32. package/i18n/locales/et.json +1 -0
  33. package/i18n/locales/fi.json +1 -0
  34. package/i18n/locales/fr.json +1 -0
  35. package/i18n/locales/he.json +1 -0
  36. package/i18n/locales/hi.json +1 -0
  37. package/i18n/locales/hy.json +1 -0
  38. package/i18n/locales/id.json +1 -0
  39. package/i18n/locales/it.json +1 -0
  40. package/i18n/locales/ja.json +1 -0
  41. package/i18n/locales/kk.json +1 -0
  42. package/i18n/locales/km.json +1 -0
  43. package/i18n/locales/ko.json +1 -0
  44. package/i18n/locales/ky.json +1 -0
  45. package/i18n/locales/lb.json +1 -0
  46. package/i18n/locales/ms.json +1 -0
  47. package/i18n/locales/nb.json +1 -0
  48. package/i18n/locales/nl.json +1 -0
  49. package/i18n/locales/pl.json +1 -0
  50. package/i18n/locales/pt-BR.json +1 -0
  51. package/i18n/locales/ro.json +1 -0
  52. package/i18n/locales/ru.json +1 -0
  53. package/i18n/locales/si.json +1 -0
  54. package/i18n/locales/sl.json +1 -0
  55. package/i18n/locales/sv.json +1 -0
  56. package/i18n/locales/tr.json +1 -0
  57. package/i18n/locales/uk.json +1 -0
  58. package/i18n/locales/ur.json +1 -0
  59. package/i18n/locales/vi.json +1 -0
  60. package/i18n/locales/zh-CN.json +1 -0
  61. package/modules/assistant/runtime/components/AssistantChat.vue +2 -2
  62. package/modules/assistant/runtime/components/AssistantPanel.vue +1 -1
  63. package/modules/assistant/runtime/components/AssistantPreStream.vue +1 -1
  64. package/modules/assistant/runtime/composables/useAssistant.ts +7 -3
  65. package/modules/assistant/runtime/server/api/search.ts +3 -2
  66. package/modules/config.ts +18 -6
  67. package/modules/markdown-rewrite.ts +7 -3
  68. package/modules/routing.ts +4 -1
  69. package/nuxt.config.ts +24 -2
  70. package/nuxt.schema.ts +15 -1
  71. package/package.json +13 -14
  72. package/server/mcp/tools/get-page.ts +2 -4
  73. package/server/mcp/tools/list-pages.ts +2 -1
  74. package/server/routes/sitemap.xml.ts +3 -3
@@ -24,7 +24,7 @@ WORKFLOW: This tool returns the complete page content including title, descripti
24
24
  handler: async ({ path }) => {
25
25
  const event = useEvent()
26
26
  const config = useRuntimeConfig(event).public
27
- const siteUrl = import.meta.dev ? 'http://localhost:3000' : inferSiteURL()
27
+ const siteUrl = getRequestURL(event).origin || inferSiteURL()
28
28
 
29
29
  const availableLocales = getAvailableLocales(config)
30
30
  const collectionName = config.i18n?.locales
@@ -41,9 +41,7 @@ WORKFLOW: This tool returns the complete page content including title, descripti
41
41
  return errorResult('Page not found')
42
42
  }
43
43
 
44
- const content = await $fetch<string>(`/raw${path}.md`, {
45
- baseURL: siteUrl,
46
- })
44
+ const content = await event.$fetch<string>(`/raw${path}.md`)
47
45
 
48
46
  return jsonResult({
49
47
  title: page.title,
@@ -2,6 +2,7 @@ import { z } from 'zod'
2
2
  import { queryCollection } from '@nuxt/content/server'
3
3
  import type { Collections } from '@nuxt/content'
4
4
  import { getCollectionsToQuery, getAvailableLocales } from '../../utils/content'
5
+ import { inferSiteURL } from '../../../utils/meta'
5
6
 
6
7
  export default defineMcpTool({
7
8
  description: `Lists all available documentation pages with their categories and basic information.
@@ -30,7 +31,7 @@ OUTPUT: Returns a structured list with:
30
31
  const event = useEvent()
31
32
  const config = useRuntimeConfig(event).public
32
33
 
33
- const siteUrl = import.meta.dev ? 'http://localhost:3000' : getRequestURL(event).origin
34
+ const siteUrl = getRequestURL(event).origin || inferSiteURL()
34
35
  const availableLocales = getAvailableLocales(config)
35
36
  const collections = getCollectionsToQuery(locale, availableLocales)
36
37
 
@@ -27,11 +27,11 @@ export default defineEventHandler(async (event) => {
27
27
 
28
28
  for (const collection of collections) {
29
29
  try {
30
- const pages = await queryCollection(event, collection as 'docs').all()
30
+ const pages = await (queryCollection as unknown as (event: unknown, collection: string) => { all: () => Promise<Array<Record<string, unknown> & { path?: string }>> })(event, collection).all()
31
31
 
32
32
  for (const page of pages) {
33
- const meta = page as unknown as Record<string, unknown>
34
- const pagePath = (page.path as string) || '/'
33
+ const meta = page as Record<string, unknown>
34
+ const pagePath = page.path || '/'
35
35
 
36
36
  // Skip pages with sitemap: false in frontmatter
37
37
  if (meta.sitemap === false) continue