@lupinum/ginko-docs 0.4.0-rc.9 → 0.5.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 (304) hide show
  1. package/CHANGELOG.md +141 -0
  2. package/LICENSE +1 -1
  3. package/README.md +300 -53
  4. package/app/app.config.ts +44 -55
  5. package/app/assets/docs.css +619 -0
  6. package/app/components/DocsBanner.vue +29 -0
  7. package/app/components/DocsExample.vue +43 -0
  8. package/app/components/DocsFooter.vue +19 -0
  9. package/app/components/DocsHeader.vue +113 -0
  10. package/app/components/DocsIcon.vue +12 -0
  11. package/app/components/DocsLanding.vue +58 -0
  12. package/app/components/DocsLanguage.vue +40 -0
  13. package/app/components/DocsNavSheet.vue +37 -0
  14. package/app/components/DocsNavTree.vue +38 -0
  15. package/app/components/DocsPage.vue +88 -0
  16. package/app/components/DocsPageActions.vue +47 -0
  17. package/app/components/DocsPageEnd.ts +12 -0
  18. package/app/components/DocsPost.vue +58 -0
  19. package/app/components/DocsSearch.vue +136 -0
  20. package/app/components/DocsShell.vue +36 -0
  21. package/app/components/DocsSidebar.vue +19 -0
  22. package/app/components/DocsSidebarEnd.ts +4 -0
  23. package/app/components/DocsTable.vue +11 -0
  24. package/app/components/DocsThemeToggle.vue +45 -0
  25. package/app/components/DocsToc.vue +73 -0
  26. package/app/composables/useDocs.ts +53 -0
  27. package/app/composables/useDocsBlog.ts +33 -0
  28. package/app/composables/useDocsCopy.ts +17 -0
  29. package/app/composables/useDocsFrame.ts +11 -0
  30. package/app/composables/useDocsPopover.ts +36 -0
  31. package/app/composables/useDocsSite.ts +31 -0
  32. package/app/docs-pages/blog.vue +55 -0
  33. package/app/docs-pages/changelog.vue +35 -0
  34. package/app/docs-pages/doc.vue +16 -0
  35. package/app/docs-pages/docs.vue +9 -0
  36. package/app/docs-pages/index.vue +12 -0
  37. package/app/docs-pages/post.vue +8 -0
  38. package/app/error.vue +38 -115
  39. package/app/layouts/default.vue +29 -7
  40. package/app/lib/blogTypes.ts +8 -0
  41. package/app/lib/docsFirst.ts +11 -0
  42. package/app/lib/docsInit.ts +18 -0
  43. package/app/lib/docsNav.ts +36 -0
  44. package/app/lib/docsPage.ts +84 -0
  45. package/app/lib/markdownComponents.ts +15 -0
  46. package/app/lib/previewToc.ts +18 -0
  47. package/dist/config.d.mts +252 -0
  48. package/dist/config.d.ts +252 -0
  49. package/dist/config.mjs +83 -0
  50. package/dist/icons.d.mts +38 -0
  51. package/dist/icons.d.ts +38 -0
  52. package/dist/icons.mjs +175 -0
  53. package/dist/pages.d.mts +5 -0
  54. package/dist/pages.d.ts +5 -0
  55. package/dist/pages.mjs +68 -0
  56. package/i18n/de.json +1 -0
  57. package/i18n/en.json +1 -0
  58. package/i18n/fr.json +1 -0
  59. package/icons/README.md +2 -0
  60. package/icons/bluesky.svg +1 -0
  61. package/icons/claude.svg +1 -0
  62. package/icons/discord.svg +1 -0
  63. package/icons/github.svg +1 -0
  64. package/icons/linkedin.svg +1 -0
  65. package/icons/mastodon.svg +1 -0
  66. package/icons/openai.svg +1 -0
  67. package/icons/x.svg +1 -0
  68. package/icons/youtube.svg +1 -0
  69. package/nuxt.config.ts +22 -212
  70. package/package.json +44 -76
  71. package/public/_docs/fonts/LICENSE +188 -0
  72. package/public/_docs/fonts/inter-latin-wght-normal.woff2 +0 -0
  73. package/public/_docs/fonts/jetbrains-mono-latin-400-normal.woff2 +0 -0
  74. package/public/_docs/fonts/jetbrains-mono-latin-500-normal.woff2 +0 -0
  75. package/server/feeds/blog-locale.get.ts +9 -0
  76. package/server/feeds/blog.get.ts +4 -0
  77. package/server/lib/blogFeed.ts +35 -0
  78. package/server/mcp/handler.ts +108 -0
  79. package/server/routes/__ginko/docs-mcp.ts +35 -0
  80. package/shared/layerRoutes.ts +66 -0
  81. package/shared/paths.ts +4 -0
  82. package/app/app.vue +0 -98
  83. package/app/assets/css/prose.css +0 -3240
  84. package/app/assets/css/tailwind.css +0 -394
  85. package/app/assets/css/theme-palettes.css +0 -309
  86. package/app/assets/css/theme-presets.css +0 -141
  87. package/app/components/OgImage/GinkoDocs.satori.vue +0 -238
  88. package/app/components/content/DocumentPageShell.vue +0 -55
  89. package/app/components/content/Feedback.vue +0 -102
  90. package/app/components/content/ImageZoomDialog.vue +0 -84
  91. package/app/components/content/PageMarkdownCopy.vue +0 -104
  92. package/app/components/content/imageZoom.ts +0 -25
  93. package/app/components/mdc/MdcAccordion.vue +0 -67
  94. package/app/components/mdc/MdcAccordionItem.vue +0 -42
  95. package/app/components/mdc/MdcApi.vue +0 -159
  96. package/app/components/mdc/MdcAside.vue +0 -23
  97. package/app/components/mdc/MdcCallout.vue +0 -61
  98. package/app/components/mdc/MdcCard.vue +0 -175
  99. package/app/components/mdc/MdcCards.vue +0 -30
  100. package/app/components/mdc/MdcCenter.vue +0 -71
  101. package/app/components/mdc/MdcCodeGroup.vue +0 -197
  102. package/app/components/mdc/MdcCodeTree.vue +0 -234
  103. package/app/components/mdc/MdcCollapse.vue +0 -61
  104. package/app/components/mdc/MdcColumn.vue +0 -70
  105. package/app/components/mdc/MdcDropcap.vue +0 -84
  106. package/app/components/mdc/MdcError.vue +0 -23
  107. package/app/components/mdc/MdcExcerpt.vue +0 -26
  108. package/app/components/mdc/MdcFigure.vue +0 -85
  109. package/app/components/mdc/MdcFiles.vue +0 -120
  110. package/app/components/mdc/MdcIdea.vue +0 -17
  111. package/app/components/mdc/MdcInfo.vue +0 -17
  112. package/app/components/mdc/MdcInlineToc.vue +0 -51
  113. package/app/components/mdc/MdcKbd.vue +0 -10
  114. package/app/components/mdc/MdcLayout.vue +0 -57
  115. package/app/components/mdc/MdcNote.vue +0 -17
  116. package/app/components/mdc/MdcQuiz.vue +0 -241
  117. package/app/components/mdc/MdcQuizQuestion.vue +0 -221
  118. package/app/components/mdc/MdcReadMore.vue +0 -70
  119. package/app/components/mdc/MdcSteps.vue +0 -59
  120. package/app/components/mdc/MdcSuccess.vue +0 -23
  121. package/app/components/mdc/MdcTab.vue +0 -17
  122. package/app/components/mdc/MdcTabs.vue +0 -150
  123. package/app/components/mdc/MdcTimeline.vue +0 -17
  124. package/app/components/mdc/MdcTimelineItem.vue +0 -40
  125. package/app/components/mdc/MdcWarning.vue +0 -23
  126. package/app/components/mdc/api.utils.ts +0 -132
  127. package/app/components/mdc/code-tree.utils.ts +0 -22
  128. package/app/components/mdc/icons.ts +0 -10
  129. package/app/components/mdc/quiz.utils.ts +0 -38
  130. package/app/components/prose/ProseA.vue +0 -27
  131. package/app/components/prose/ProseBlockquote.vue +0 -30
  132. package/app/components/prose/ProseCode.vue +0 -14
  133. package/app/components/prose/ProseEm.vue +0 -14
  134. package/app/components/prose/ProseH1.vue +0 -18
  135. package/app/components/prose/ProseH2.vue +0 -29
  136. package/app/components/prose/ProseH3.vue +0 -29
  137. package/app/components/prose/ProseH4.vue +0 -29
  138. package/app/components/prose/ProseH5.vue +0 -15
  139. package/app/components/prose/ProseH6.vue +0 -15
  140. package/app/components/prose/ProseHr.vue +0 -12
  141. package/app/components/prose/ProseImg.vue +0 -55
  142. package/app/components/prose/ProseLi.vue +0 -14
  143. package/app/components/prose/ProseOl.vue +0 -14
  144. package/app/components/prose/ProseP.vue +0 -14
  145. package/app/components/prose/ProsePre.vue +0 -180
  146. package/app/components/prose/ProseStrong.vue +0 -14
  147. package/app/components/prose/ProseTable.vue +0 -18
  148. package/app/components/prose/ProseTbody.vue +0 -14
  149. package/app/components/prose/ProseTd.vue +0 -14
  150. package/app/components/prose/ProseTh.vue +0 -14
  151. package/app/components/prose/ProseThead.vue +0 -14
  152. package/app/components/prose/ProseTr.vue +0 -14
  153. package/app/components/prose/ProseUl.vue +0 -14
  154. package/app/components/site/ModeToggle.vue +0 -81
  155. package/app/components/site/SiteBanner.vue +0 -97
  156. package/app/components/site/SiteFooter.vue +0 -90
  157. package/app/components/site/SiteHeader.vue +0 -371
  158. package/app/components/site/SiteHeroCode.vue +0 -173
  159. package/app/components/site/SiteInteractionLayer.vue +0 -42
  160. package/app/components/site/SiteLocaleSwitcher.vue +0 -190
  161. package/app/components/site/SiteLogoMark.vue +0 -12
  162. package/app/components/site/SiteSkipLink.vue +0 -14
  163. package/app/components/site/SiteSocialLinks.vue +0 -33
  164. package/app/components/site/header-utils.ts +0 -3
  165. package/app/components/site/mode-toggle.utils.ts +0 -18
  166. package/app/components/ui/badge/Badge.vue +0 -28
  167. package/app/components/ui/badge/index.ts +0 -24
  168. package/app/components/ui/button/Button.vue +0 -31
  169. package/app/components/ui/button/index.ts +0 -35
  170. package/app/components/ui/collapsible/Collapsible.vue +0 -15
  171. package/app/components/ui/collapsible/CollapsibleContent.vue +0 -25
  172. package/app/components/ui/collapsible/CollapsibleTrigger.vue +0 -12
  173. package/app/components/ui/collapsible/index.ts +0 -3
  174. package/app/components/ui/dropdown-menu/DropdownMenu.vue +0 -15
  175. package/app/components/ui/dropdown-menu/DropdownMenuContent.vue +0 -50
  176. package/app/components/ui/dropdown-menu/DropdownMenuItem.vue +0 -41
  177. package/app/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +0 -15
  178. package/app/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +0 -37
  179. package/app/components/ui/dropdown-menu/DropdownMenuSeparator.vue +0 -23
  180. package/app/components/ui/dropdown-menu/DropdownMenuTrigger.vue +0 -14
  181. package/app/components/ui/dropdown-menu/index.ts +0 -7
  182. package/app/components/ui/kbd/Kbd.vue +0 -23
  183. package/app/components/ui/kbd/index.ts +0 -21
  184. package/app/components/ui/scroll-area/ScrollArea.vue +0 -39
  185. package/app/components/ui/scroll-area/ScrollBar.vue +0 -33
  186. package/app/components/ui/scroll-area/index.ts +0 -2
  187. package/app/components/ui/separator/Separator.vue +0 -27
  188. package/app/components/ui/separator/index.ts +0 -1
  189. package/app/components/ui/sheet/Sheet.vue +0 -15
  190. package/app/components/ui/sheet/SheetContent.vue +0 -59
  191. package/app/components/ui/sheet/SheetDescription.vue +0 -21
  192. package/app/components/ui/sheet/SheetOverlay.vue +0 -26
  193. package/app/components/ui/sheet/SheetTitle.vue +0 -21
  194. package/app/components/ui/sheet/SheetTrigger.vue +0 -12
  195. package/app/components/ui/sheet/index.ts +0 -5
  196. package/app/components/ui/tabs/Tabs.vue +0 -24
  197. package/app/components/ui/tabs/TabsList.vue +0 -26
  198. package/app/components/ui/tabs/TabsTrigger.vue +0 -28
  199. package/app/components/ui/tabs/index.ts +0 -3
  200. package/app/composables/site-navigation.utils.ts +0 -133
  201. package/app/composables/useCanonicalUrl.ts +0 -9
  202. package/app/composables/useContentRouteAlternates.ts +0 -35
  203. package/app/composables/useGinkoAnalytics.ts +0 -52
  204. package/app/composables/useGinkoDocsConfig.ts +0 -6
  205. package/app/composables/useGinkoOgImage.ts +0 -20
  206. package/app/composables/useLocalizedPath.ts +0 -12
  207. package/app/composables/useLocalizedRouteSwitch.ts +0 -31
  208. package/app/composables/useMetaKey.ts +0 -18
  209. package/app/composables/usePageMarkdownActions.ts +0 -79
  210. package/app/composables/useProseAppearance.ts +0 -24
  211. package/app/composables/useSchemaJsonLd.ts +0 -25
  212. package/app/composables/useSiteNavigation.ts +0 -64
  213. package/app/config/site.utils.ts +0 -36
  214. package/app/features/docs/components/DocsBreadcrumb.vue +0 -37
  215. package/app/features/docs/components/DocsContributeLinks.vue +0 -75
  216. package/app/features/docs/components/DocsMobileToc.vue +0 -108
  217. package/app/features/docs/components/DocsPageContent.vue +0 -234
  218. package/app/features/docs/components/DocsPageNav.vue +0 -57
  219. package/app/features/docs/components/DocsSidebar.vue +0 -145
  220. package/app/features/docs/components/DocsSidebarDropdown.vue +0 -70
  221. package/app/features/docs/components/DocsSidebarItem.vue +0 -122
  222. package/app/features/docs/components/DocsSidebarList.vue +0 -35
  223. package/app/features/docs/components/DocsSidebarRow.vue +0 -27
  224. package/app/features/docs/components/DocsSidebarTabs.vue +0 -59
  225. package/app/features/docs/components/DocsToc.vue +0 -106
  226. package/app/features/docs/composables/useDocsNavigation.ts +0 -29
  227. package/app/features/docs/composables/useDocsNavigationData.ts +0 -18
  228. package/app/features/docs/composables/useRevealActive.ts +0 -58
  229. package/app/features/docs/composables/useScrollspy.ts +0 -135
  230. package/app/features/docs/docs-navigation.ts +0 -157
  231. package/app/features/docs/toc-context.ts +0 -6
  232. package/app/features/search/command-center.ts +0 -110
  233. package/app/features/search/components/SiteCommandCenter.vue +0 -359
  234. package/app/features/search/components/SiteSearchPageHighlight.vue +0 -126
  235. package/app/features/search/useCommandCenter.ts +0 -292
  236. package/app/layouts/blog.vue +0 -15
  237. package/app/layouts/docs.vue +0 -20
  238. package/app/lib/errors.ts +0 -37
  239. package/app/lib/schema-org.ts +0 -38
  240. package/app/pages/blog/[slug].vue +0 -228
  241. package/app/pages/blog/index.vue +0 -130
  242. package/app/pages/docs/[...slug].vue +0 -10
  243. package/app/pages/docs/index.vue +0 -19
  244. package/app/pages/index.vue +0 -278
  245. package/app/plugins/ginko-docs-theme.ts +0 -14
  246. package/app/plugins/ssr-width.ts +0 -6
  247. package/app/utils/content.ts +0 -67
  248. package/app/utils/file-icons.ts +0 -90
  249. package/app/utils/index.ts +0 -7
  250. package/app/utils/repository.ts +0 -20
  251. package/components.ts +0 -9
  252. package/content-collections.ts +0 -89
  253. package/content.js +0 -200
  254. package/content.ts +0 -104
  255. package/i18n/i18n.config.ts +0 -10
  256. package/i18n/locales.ts +0 -81
  257. package/i18n/messages/global/banner.ts +0 -8
  258. package/i18n/messages/global/blog.ts +0 -18
  259. package/i18n/messages/global/command.ts +0 -49
  260. package/i18n/messages/global/docs.ts +0 -36
  261. package/i18n/messages/global/errors.ts +0 -36
  262. package/i18n/messages/global/feedback.ts +0 -11
  263. package/i18n/messages/global/index.ts +0 -21
  264. package/i18n/messages/global/nav.ts +0 -26
  265. package/i18n/messages/global/site.ts +0 -4
  266. package/i18n/messages/global/theme.ts +0 -9
  267. package/i18n/messages/index.ts +0 -20
  268. package/i18n/messages/localize.ts +0 -35
  269. package/i18n/routes.ts +0 -33
  270. package/icon-bundle.ts +0 -116
  271. package/index.d.ts +0 -37
  272. package/modules/analytics-boundary.ts +0 -23
  273. package/modules/feature-routing.ts +0 -68
  274. package/modules/syntax-highlighting.ts +0 -120
  275. package/public/fonts/public-sans/LICENSE +0 -93
  276. package/public/fonts/public-sans/README.md +0 -12
  277. package/public/fonts/public-sans/public-sans-400-normal-latin.woff +0 -0
  278. package/public/fonts/public-sans/public-sans-500-normal-latin.woff +0 -0
  279. package/public/fonts/public-sans/public-sans-600-normal-latin.woff +0 -0
  280. package/public/fonts/public-sans/public-sans-700-normal-latin.woff +0 -0
  281. package/runtime/generate-favicons.mjs +0 -124
  282. package/runtime/server/agent-markdown.ts +0 -19
  283. package/server/api/_ginko-docs/redirects.get.ts +0 -28
  284. package/server/mcp/tools/get-page.ts +0 -14
  285. package/server/mcp/tools/list-pages.ts +0 -10
  286. package/server/middleware/redirects.ts +0 -22
  287. package/server/plugins/agent-markdown.ts +0 -6
  288. package/server/plugins/sitemap-policy.ts +0 -12
  289. package/server/routes/.well-known/ai-catalog.json.get.ts +0 -10
  290. package/server/routes/[locale]/blog/rss.xml.get.ts +0 -13
  291. package/server/routes/blog/rss.xml.get.ts +0 -5
  292. package/server/routes/mcp/server-card.get.ts +0 -14
  293. package/server/utils/blog-feed.ts +0 -51
  294. package/server/utils/feed.ts +0 -70
  295. package/server/utils/mcp-server-card.ts +0 -45
  296. package/server/utils/redirects.ts +0 -38
  297. package/server/utils/redirects.utils.ts +0 -58
  298. package/server/utils/sitemap.ts +0 -45
  299. package/shared/route-slugs.ts +0 -5
  300. package/shared/theme-palettes.ts +0 -37
  301. package/shared/theme-presets.ts +0 -3
  302. package/shared/types/app-config.ts +0 -172
  303. package/shared/types/nuxt-config.ts +0 -14
  304. package/tags.ts +0 -192
@@ -1,26 +0,0 @@
1
- export const nav = {
2
- skip: { de: "Zum Hauptinhalt springen", en: "Skip to main content" },
3
- home: { de: "Startseite", en: "Home" },
4
- main: { de: "Hauptnavigation", en: "Main navigation" },
5
- mobile: { de: "Mobile Navigation", en: "Mobile navigation" },
6
- menu: { de: "Menü", en: "Menu" },
7
- docsDescription: {
8
- de: "Anleitungen, Komponenten, Referenz",
9
- en: "Guides, components, reference",
10
- },
11
- blogDescription: { de: "Releases und Artikel", en: "Releases and writing" },
12
- language: { de: "Sprache wechseln", en: "Change language" },
13
- openMenu: { de: "Menü öffnen", en: "Open menu" },
14
- closeMenu: { de: "Menü schließen", en: "Close menu" },
15
- search: { de: "Suchen", en: "Search" },
16
- searchDocumentation: {
17
- de: "Dokumentation durchsuchen…",
18
- en: "Search documentation…",
19
- },
20
- languageLabel: { de: "Sprache", en: "Language" },
21
- resources: { de: "Ressourcen", en: "Resources" },
22
- company: { de: "Unternehmen", en: "Company" },
23
- documentation: { de: "Dokumentation", en: "Documentation" },
24
- blog: { de: "Blog", en: "Blog" },
25
- externalLink: { de: "externer Link", en: "external link" },
26
- } as const;
@@ -1,4 +0,0 @@
1
- export const site = {
2
- footer: { de: "Alle Rechte vorbehalten.", en: "All rights reserved." },
3
- openSourceBy: { de: "Open Source von", en: "Open source by" },
4
- } as const;
@@ -1,9 +0,0 @@
1
- export const theme = {
2
- label: { de: "Darstellung", en: "Appearance" },
3
- toggle: { de: "Darstellung umschalten", en: "Toggle theme" },
4
- switchToDark: { de: "Zu Dunkelmodus wechseln", en: "Switch to dark mode" },
5
- switchToLight: { de: "Zu Hellmodus wechseln", en: "Switch to light mode" },
6
- light: { de: "Hell", en: "Light" },
7
- dark: { de: "Dunkel", en: "Dark" },
8
- system: { de: "System", en: "System" },
9
- } as const;
@@ -1,20 +0,0 @@
1
- import { type LocaleCode, localeCodes } from "../locales";
2
- import { localizedRoutes } from "../routes";
3
- import { globalMessages } from "./global";
4
- import { localizeMessages } from "./localize";
5
-
6
- export const messages = localeCodes.reduce(
7
- (localizedMessages, locale) => {
8
- localizedMessages[locale] = {
9
- ...localizeMessages(globalMessages, locale),
10
- routes: localizedRoutes[locale],
11
- };
12
- return localizedMessages;
13
- },
14
- {} as Record<
15
- LocaleCode,
16
- ReturnType<typeof localizeMessages<typeof globalMessages>> & {
17
- routes: (typeof localizedRoutes)[LocaleCode];
18
- }
19
- >,
20
- );
@@ -1,35 +0,0 @@
1
- import type { LocaleCode } from "../locales";
2
- import { localeCodes } from "../locales";
3
-
4
- type LocalizedLeaf = Record<LocaleCode, string>;
5
-
6
- export type LocalizedMessages<T> = T extends LocalizedLeaf
7
- ? string
8
- : T extends readonly (infer TItem)[]
9
- ? LocalizedMessages<TItem>[]
10
- : T extends object
11
- ? { [TKey in keyof T]: LocalizedMessages<T[TKey]> }
12
- : T;
13
-
14
- function isLocalizedLeaf(value: unknown): value is LocalizedLeaf {
15
- return (
16
- !!value &&
17
- typeof value === "object" &&
18
- !Array.isArray(value) &&
19
- Object.keys(value).length === localeCodes.length &&
20
- localeCodes.every((locale) => typeof (value as Partial<LocalizedLeaf>)[locale] === "string")
21
- );
22
- }
23
-
24
- export function localizeMessages<T>(source: T, locale: LocaleCode): LocalizedMessages<T> {
25
- if (isLocalizedLeaf(source)) return source[locale] as LocalizedMessages<T>;
26
- if (Array.isArray(source)) {
27
- return source.map((item) => localizeMessages(item, locale)) as LocalizedMessages<T>;
28
- }
29
- if (source && typeof source === "object") {
30
- return Object.fromEntries(
31
- Object.entries(source).map(([key, value]) => [key, localizeMessages(value, locale)]),
32
- ) as LocalizedMessages<T>;
33
- }
34
- return source as LocalizedMessages<T>;
35
- }
package/i18n/routes.ts DELETED
@@ -1,33 +0,0 @@
1
- import { type LocaleCode, localeCodes } from "./locales";
2
- import { routeSlugs } from "../shared/route-slugs";
3
-
4
- export const localizedRoutes = {
5
- en: {
6
- home: routeSlugs.home.en,
7
- docs: routeSlugs.docs.en,
8
- blog: routeSlugs.blog.en,
9
- },
10
- de: {
11
- home: routeSlugs.home.de,
12
- docs: routeSlugs.docs.de,
13
- blog: routeSlugs.blog.de,
14
- },
15
- } as const satisfies Record<LocaleCode, Record<string, string>>;
16
-
17
- export type LocalizedRouteKey = keyof (typeof localizedRoutes)[LocaleCode];
18
-
19
- const catchAllPage = <const T extends string>(route: T): `${T}/[...slug]` => `${route}/[...slug]`;
20
- const singleSlugPage = <const T extends string>(route: T): `${T}/[slug]` => `${route}/[slug]`;
21
- const routeMap = <T>(getRoute: (locale: LocaleCode) => T): Record<LocaleCode, T> =>
22
- Object.fromEntries(localeCodes.map((locale) => [locale, getRoute(locale)])) as Record<
23
- LocaleCode,
24
- T
25
- >;
26
-
27
- export const i18nPages = {
28
- index: routeMap((locale) => localizedRoutes[locale].home),
29
- docs: routeMap((locale) => localizedRoutes[locale].docs),
30
- "docs-slug": routeMap((locale) => catchAllPage(localizedRoutes[locale].docs)),
31
- blog: routeMap((locale) => localizedRoutes[locale].blog),
32
- "blog-slug": routeMap((locale) => singleSlugPage(localizedRoutes[locale].blog)),
33
- };
package/icon-bundle.ts DELETED
@@ -1,116 +0,0 @@
1
- import { createRequire } from "node:module";
2
-
3
- export const layerIconNames = [
4
- "circle-flags:de",
5
- "circle-flags:us",
6
- "ginko-social:discord",
7
- "ginko-social:github",
8
- "logos:bun",
9
- "logos:npm-icon",
10
- "logos:nuxt-icon",
11
- "logos:pnpm",
12
- "logos:typescript-icon",
13
- "logos:vue",
14
- "logos:yarn",
15
- "lucide:arrow-left",
16
- "lucide:arrow-right",
17
- "lucide:arrow-up",
18
- "lucide:arrow-up-right",
19
- "lucide:atom",
20
- "lucide:badge-check",
21
- "lucide:blocks",
22
- "lucide:book-open",
23
- "lucide:bookmark",
24
- "lucide:calendar",
25
- "lucide:braces",
26
- "lucide:building-2",
27
- "lucide:check",
28
- "lucide:chevron-down",
29
- "lucide:chevron-left",
30
- "lucide:chevron-right",
31
- "lucide:chevrons-up-down",
32
- "lucide:circle",
33
- "lucide:circle-alert",
34
- "lucide:circle-check",
35
- "lucide:circle-help",
36
- "lucide:circle-x",
37
- "lucide:clipboard",
38
- "lucide:clock",
39
- "lucide:code-xml",
40
- "lucide:copy",
41
- "lucide:file",
42
- "lucide:file-code",
43
- "lucide:file-code-2",
44
- "lucide:file-cog",
45
- "lucide:file-json",
46
- "lucide:file-key",
47
- "lucide:file-text",
48
- "lucide:folder",
49
- "lucide:folder-open",
50
- "lucide:git-branch",
51
- "lucide:github",
52
- "lucide:hash",
53
- "lucide:home",
54
- "lucide:info",
55
- "lucide:lightbulb",
56
- "lucide:link",
57
- "lucide:languages",
58
- "lucide:linkedin",
59
- "lucide:loader-circle",
60
- "lucide:list",
61
- "lucide:menu",
62
- "lucide:message-circle",
63
- "lucide:monitor",
64
- "lucide:moon",
65
- "lucide:newspaper",
66
- "lucide:package",
67
- "lucide:palette",
68
- "lucide:panel-left-open",
69
- "lucide:pen-line",
70
- "lucide:plug",
71
- "lucide:search",
72
- "lucide:server",
73
- "lucide:sparkles",
74
- "lucide:sun",
75
- "lucide:table",
76
- "lucide:terminal",
77
- "lucide:thumbs-down",
78
- "lucide:thumbs-up",
79
- "lucide:triangle-alert",
80
- "lucide:trophy",
81
- "lucide:x",
82
- "lucide:zap",
83
- ] as const;
84
-
85
- type IconCollection = {
86
- prefix: string;
87
- width?: number;
88
- height?: number;
89
- icons: Record<string, { body: string }>;
90
- aliases?: Record<string, { parent: string }>;
91
- };
92
-
93
- const require = createRequire(import.meta.url);
94
-
95
- const ginkoSocialCollection = {
96
- prefix: "ginko-social",
97
- width: 24,
98
- height: 24,
99
- icons: {
100
- // Google Material Icons: https://github.com/material-icons/material-icons/blob/master/LICENSE
101
- discord: {
102
- body: '<path fill="currentColor" d="M19.27 5.33C17.94 4.71 16.5 4.26 15 4a.1.1 0 0 0-.07.03c-.18.33-.39.76-.53 1.09a16.1 16.1 0 0 0-4.8 0c-.14-.34-.35-.76-.54-1.09c-.01-.02-.04-.03-.07-.03c-1.5.26-2.93.71-4.27 1.33c-.01 0-.02.01-.03.02c-2.72 4.07-3.47 8.03-3.1 11.95c0 .02.01.04.03.05c1.8 1.32 3.53 2.12 5.24 2.65c.03.01.06 0 .07-.02c.4-.55.76-1.13 1.07-1.74c.02-.04 0-.08-.04-.09c-.57-.22-1.11-.48-1.64-.78c-.04-.02-.04-.08-.01-.11c.11-.08.22-.17.33-.25c.02-.02.05-.02.07-.01c3.44 1.57 7.15 1.57 10.55 0c.02-.01.05-.01.07.01c.11.09.22.17.33.26c.04.03.04.09-.01.11c-.52.31-1.07.56-1.64.78c-.04.01-.05.06-.04.09c.32.61.68 1.19 1.07 1.74c.03.01.06.02.09.01c1.72-.53 3.45-1.33 5.25-2.65c.02-.01.03-.03.03-.05c.44-4.53-.73-8.46-3.1-11.95c-.01-.01-.02-.02-.04-.02M8.52 14.91c-1.03 0-1.89-.95-1.89-2.12s.84-2.12 1.89-2.12c1.06 0 1.9.96 1.89 2.12c0 1.17-.84 2.12-1.89 2.12m6.97 0c-1.03 0-1.89-.95-1.89-2.12s.84-2.12 1.89-2.12c1.06 0 1.9.96 1.89 2.12c0 1.17-.83 2.12-1.89 2.12"/>',
103
- },
104
- // Material Design Icons: https://github.com/Templarian/MaterialDesign/blob/master/LICENSE
105
- github: {
106
- body: '<path fill="currentColor" d="M12 2A10 10 0 0 0 2 12c0 4.42 2.87 8.17 6.84 9.5c.5.08.66-.23.66-.5v-1.69c-2.77.6-3.36-1.34-3.36-1.34c-.46-1.16-1.11-1.47-1.11-1.47c-.91-.62.07-.6.07-.6c1 .07 1.53 1.03 1.53 1.03c.87 1.52 2.34 1.07 2.91.83c.09-.65.35-1.09.63-1.34c-2.22-.25-4.55-1.11-4.55-4.92c0-1.11.38-2 1.03-2.71c-.1-.25-.45-1.29.1-2.64c0 0 .84-.27 2.75 1.02c.79-.22 1.65-.33 2.5-.33s1.71.11 2.5.33c1.91-1.29 2.75-1.02 2.75-1.02c.55 1.35.2 2.39.1 2.64c.65.71 1.03 1.6 1.03 2.71c0 3.82-2.34 4.66-4.57 4.91c.36.31.69.92.69 1.85V21c0 .27.16.59.67.5C19.14 20.16 22 16.42 22 12A10 10 0 0 0 12 2"/>',
107
- },
108
- },
109
- } satisfies IconCollection;
110
-
111
- export const layerIconCollections = [
112
- ...["circle-flags", "logos", "lucide"].map(
113
- (prefix) => require(`@iconify-json/${prefix}/icons.json`) as IconCollection,
114
- ),
115
- ginkoSocialCollection,
116
- ];
package/index.d.ts DELETED
@@ -1,37 +0,0 @@
1
- import type { GinkoDocsAppConfig } from "./shared/types/app-config";
2
- import type {
3
- GinkoDocsNuxtConfig,
4
- GinkoDocsSyntaxHighlightingConfig,
5
- } from "./shared/types/nuxt-config";
6
-
7
- type GinkoDocsAppConfigInput<T> = T extends readonly unknown[]
8
- ? T
9
- : T extends object
10
- ? { [Key in keyof T]?: GinkoDocsAppConfigInput<T[Key]> }
11
- : T;
12
-
13
- declare module "nuxt/schema" {
14
- interface AppConfig {
15
- ginkoDocs: GinkoDocsAppConfig;
16
- }
17
-
18
- interface AppConfigInput {
19
- ginkoDocs?: GinkoDocsAppConfigInput<GinkoDocsAppConfig>;
20
- }
21
-
22
- interface NuxtConfig {
23
- ginkoDocs?: GinkoDocsNuxtConfig;
24
- }
25
-
26
- interface NuxtOptions {
27
- ginkoDocs?: GinkoDocsNuxtConfig;
28
- }
29
-
30
- interface PublicRuntimeConfig {
31
- ginkoDocs?: {
32
- syntaxHighlighting?: GinkoDocsSyntaxHighlightingConfig;
33
- };
34
- }
35
- }
36
-
37
- export {};
@@ -1,23 +0,0 @@
1
- import { defineNuxtModule } from "@nuxt/kit";
2
-
3
- function componentDirectoryPath(entry: string | { path: string }) {
4
- return (typeof entry === "string" ? entry : entry.path).replaceAll("\\", "/");
5
- }
6
-
7
- export function isNuxtScriptsComponentDirectory(entry: string | { path: string }) {
8
- const path = componentDirectoryPath(entry);
9
- return (
10
- (path.includes("/node_modules/@nuxt/scripts/") || path.includes("/@nuxt+scripts@")) &&
11
- path.endsWith("/node_modules/@nuxt/scripts/dist/runtime/components")
12
- );
13
- }
14
-
15
- export default defineNuxtModule({
16
- meta: { name: "ginko-docs-analytics-boundary" },
17
- setup(_options, nuxt) {
18
- nuxt.hook("components:dirs", (dirs) => {
19
- const usedDirectories = dirs.filter((entry) => !isNuxtScriptsComponentDirectory(entry));
20
- dirs.splice(0, dirs.length, ...usedDirectories);
21
- });
22
- },
23
- });
@@ -1,68 +0,0 @@
1
- import { defineNuxtModule, installModule } from "@nuxt/kit";
2
- import type {} from "@lupinum/ginko-content";
3
- import { defaultLocale, localeCodes, locales, localizedPath } from "../i18n/locales";
4
- import { routeSlugs } from "../shared/route-slugs";
5
-
6
- interface PageRoute {
7
- path: string;
8
- }
9
-
10
- export const blogFeedRoutes = localeCodes.map(
11
- (locale) => `${localizedPath(locale, routeSlugs.blog[locale])}/rss.xml`,
12
- );
13
-
14
- export function removeBlogPages(pages: PageRoute[], blogEnabled: boolean) {
15
- if (blogEnabled) return;
16
-
17
- for (let index = pages.length - 1; index >= 0; index -= 1) {
18
- const page = pages[index];
19
- if (page && (page.path === "/blog" || page.path.startsWith("/blog/"))) {
20
- pages.splice(index, 1);
21
- }
22
- }
23
- }
24
-
25
- export default defineNuxtModule({
26
- meta: { name: "ginko-docs-feature-routing" },
27
- async setup(_options, nuxt) {
28
- const fallback = locales.find((locale) => locale.code === defaultLocale);
29
- if (!fallback) throw new Error(`Missing locale definition for ${defaultLocale}.`);
30
- const configuredLocales = nuxt.options.i18n?.locales;
31
- if (!Array.isArray(configuredLocales) || configuredLocales.length === 0) {
32
- nuxt.options.i18n = {
33
- ...nuxt.options.i18n,
34
- locales: [{ code: fallback.code, language: fallback.language, name: fallback.name }],
35
- };
36
- } else if (configuredLocales.length > 1) {
37
- const fallbackIndex = configuredLocales.findIndex(
38
- (locale) =>
39
- typeof locale === "object" &&
40
- locale !== null &&
41
- locale.code === fallback.code &&
42
- locale.language === fallback.language &&
43
- locale.name === fallback.name,
44
- );
45
- if (fallbackIndex >= 0) configuredLocales.splice(fallbackIndex, 1);
46
- }
47
- await installModule("@nuxtjs/i18n");
48
-
49
- let blogEnabled = false;
50
-
51
- nuxt.hook("content:context", (context) => {
52
- blogEnabled = Boolean(context.collections.blog);
53
- });
54
-
55
- nuxt.hook("pages:extend", (pages) => {
56
- removeBlogPages(pages, blogEnabled);
57
- });
58
-
59
- // content:context runs before Nitro config is finalized, so the feed
60
- // routes only prerender when the consuming app enables the blog.
61
- nuxt.hook("nitro:config", (nitroConfig) => {
62
- if (!blogEnabled) return;
63
- nitroConfig.prerender ??= {};
64
- nitroConfig.prerender.routes ??= [];
65
- nitroConfig.prerender.routes.push(...blogFeedRoutes);
66
- });
67
- },
68
- });
@@ -1,120 +0,0 @@
1
- import { defineNuxtModule } from "@nuxt/kit";
2
- import { bundledThemes } from "shiki";
3
- import type { BundledTheme } from "shiki";
4
- import type {
5
- GinkoDocsSyntaxHighlightingConfig,
6
- GinkoDocsNuxtConfig,
7
- } from "../shared/types/nuxt-config";
8
-
9
- export const DEFAULT_SYNTAX_THEMES = {
10
- light: "light-plus",
11
- dark: "dark-plus",
12
- } as const satisfies GinkoDocsSyntaxHighlightingConfig["themes"];
13
-
14
- type ShikiPluginOptions = {
15
- preStyles?: boolean;
16
- transformers?: unknown[];
17
- themes?: { light: unknown; dark: unknown };
18
- };
19
-
20
- type MarkdownPlugin = string | [string, Record<string, unknown>?];
21
-
22
- export async function resolveBundledTheme(name: string, configPath: string) {
23
- const loader = bundledThemes[name as BundledTheme];
24
- if (!loader) {
25
- throw new Error(
26
- `Invalid Ginko Docs syntax theme "${name}".\n\nExpected a bundled Shiki theme name at:\n${configPath}`,
27
- );
28
- }
29
-
30
- const mod = await loader();
31
- return mod.default ?? mod;
32
- }
33
-
34
- export function findShikiPlugin(plugins: MarkdownPlugin[]) {
35
- for (let index = 0; index < plugins.length; index += 1) {
36
- const plugin = plugins[index];
37
- if (plugin === "shiki") {
38
- return { index, options: {} as ShikiPluginOptions };
39
- }
40
- if (Array.isArray(plugin) && plugin[0] === "shiki") {
41
- return { index, options: (plugin[1] ?? {}) as ShikiPluginOptions };
42
- }
43
- }
44
- return null;
45
- }
46
-
47
- export function countShikiPlugins(plugins: MarkdownPlugin[]) {
48
- return plugins.filter(
49
- (plugin) => plugin === "shiki" || (Array.isArray(plugin) && plugin[0] === "shiki"),
50
- ).length;
51
- }
52
-
53
- export async function patchShikiThemes(
54
- plugins: MarkdownPlugin[],
55
- themes: GinkoDocsSyntaxHighlightingConfig["themes"],
56
- ) {
57
- const shiki = findShikiPlugin(plugins);
58
- if (!shiki) {
59
- throw new Error("Ginko Docs could not locate the Shiki Markdown plugin to patch.");
60
- }
61
-
62
- const [light, dark] = await Promise.all([
63
- resolveBundledTheme(themes.light, "ginkoDocs.syntaxHighlighting.themes.light"),
64
- resolveBundledTheme(themes.dark, "ginkoDocs.syntaxHighlighting.themes.dark"),
65
- ]);
66
-
67
- shiki.options.themes = { light, dark };
68
-
69
- const plugin = plugins[shiki.index];
70
- if (Array.isArray(plugin)) {
71
- plugin[1] = shiki.options;
72
- } else {
73
- plugins[shiki.index] = ["shiki", shiki.options];
74
- }
75
- }
76
-
77
- export function mergeSyntaxRuntimeConfig(
78
- current: Record<string, unknown> | undefined,
79
- themes: GinkoDocsSyntaxHighlightingConfig["themes"],
80
- ) {
81
- return {
82
- ...current,
83
- syntaxHighlighting: {
84
- themes: {
85
- light: themes.light,
86
- dark: themes.dark,
87
- },
88
- },
89
- };
90
- }
91
-
92
- export default defineNuxtModule<GinkoDocsNuxtConfig>({
93
- meta: {
94
- name: "ginko-docs-syntax-highlighting",
95
- configKey: "ginkoDocs",
96
- },
97
- async setup(options, nuxt) {
98
- const themes = options.syntaxHighlighting?.themes ?? DEFAULT_SYNTAX_THEMES;
99
-
100
- nuxt.options.runtimeConfig.public.ginkoDocs = mergeSyntaxRuntimeConfig(
101
- nuxt.options.runtimeConfig.public.ginkoDocs,
102
- themes,
103
- );
104
-
105
- if (!options.syntaxHighlighting) return;
106
-
107
- const content = nuxt.options.content;
108
- if (!content) {
109
- throw new Error("Ginko Docs could not locate the content module configuration.");
110
- }
111
-
112
- content.markdown ??= {};
113
- content.markdown.plugins ??= [];
114
-
115
- await patchShikiThemes(
116
- content.markdown.plugins as MarkdownPlugin[],
117
- options.syntaxHighlighting.themes,
118
- );
119
- },
120
- });
@@ -1,93 +0,0 @@
1
- Copyright 2015 The Public Sans Project Authors (https://github.com/uswds/public-sans) PublicSans-Italic[wght].ttf: Copyright 2015 The Public Sans Project Authors (https://github.com/uswds/public-sans)
2
-
3
- This Font Software is licensed under the SIL Open Font License, Version 1.1.
4
- This license is copied below, and is also available with a FAQ at:
5
- http://scripts.sil.org/OFL
6
-
7
-
8
- -----------------------------------------------------------
9
- SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
10
- -----------------------------------------------------------
11
-
12
- PREAMBLE
13
- The goals of the Open Font License (OFL) are to stimulate worldwide
14
- development of collaborative font projects, to support the font creation
15
- efforts of academic and linguistic communities, and to provide a free and
16
- open framework in which fonts may be shared and improved in partnership
17
- with others.
18
-
19
- The OFL allows the licensed fonts to be used, studied, modified and
20
- redistributed freely as long as they are not sold by themselves. The
21
- fonts, including any derivative works, can be bundled, embedded,
22
- redistributed and/or sold with any software provided that any reserved
23
- names are not used by derivative works. The fonts and derivatives,
24
- however, cannot be released under any other type of license. The
25
- requirement for fonts to remain under this license does not apply
26
- to any document created using the fonts or their derivatives.
27
-
28
- DEFINITIONS
29
- "Font Software" refers to the set of files released by the Copyright
30
- Holder(s) under this license and clearly marked as such. This may
31
- include source files, build scripts and documentation.
32
-
33
- "Reserved Font Name" refers to any names specified as such after the
34
- copyright statement(s).
35
-
36
- "Original Version" refers to the collection of Font Software components as
37
- distributed by the Copyright Holder(s).
38
-
39
- "Modified Version" refers to any derivative made by adding to, deleting,
40
- or substituting -- in part or in whole -- any of the components of the
41
- Original Version, by changing formats or by porting the Font Software to a
42
- new environment.
43
-
44
- "Author" refers to any designer, engineer, programmer, technical
45
- writer or other person who contributed to the Font Software.
46
-
47
- PERMISSION & CONDITIONS
48
- Permission is hereby granted, free of charge, to any person obtaining
49
- a copy of the Font Software, to use, study, copy, merge, embed, modify,
50
- redistribute, and sell modified and unmodified copies of the Font
51
- Software, subject to the following conditions:
52
-
53
- 1) Neither the Font Software nor any of its individual components,
54
- in Original or Modified Versions, may be sold by itself.
55
-
56
- 2) Original or Modified Versions of the Font Software may be bundled,
57
- redistributed and/or sold with any software, provided that each copy
58
- contains the above copyright notice and this license. These can be
59
- included either as stand-alone text files, human-readable headers or
60
- in the appropriate machine-readable metadata fields within text or
61
- binary files as long as those fields can be easily viewed by the user.
62
-
63
- 3) No Modified Version of the Font Software may use the Reserved Font
64
- Name(s) unless explicit written permission is granted by the corresponding
65
- Copyright Holder. This restriction only applies to the primary font name as
66
- presented to the users.
67
-
68
- 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
69
- Software shall not be used to promote, endorse or advertise any
70
- Modified Version, except to acknowledge the contribution(s) of the
71
- Copyright Holder(s) and the Author(s) or with their explicit written
72
- permission.
73
-
74
- 5) The Font Software, modified or unmodified, in part or in whole,
75
- must be distributed entirely under this license, and must not be
76
- distributed under any other license. The requirement for fonts to
77
- remain under this license does not apply to any document created
78
- using the Font Software.
79
-
80
- TERMINATION
81
- This license becomes null and void if any of the above conditions are
82
- not met.
83
-
84
- DISCLAIMER
85
- THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
86
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
87
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
88
- OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
89
- COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
90
- INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
91
- DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
92
- FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
93
- OTHER DEALINGS IN THE FONT SOFTWARE.
@@ -1,12 +0,0 @@
1
- # Public Sans
2
-
3
- These Latin-subset WOFF files are copied from `@fontsource/public-sans@5.3.0`:
4
-
5
- - `public-sans-latin-400-normal.woff`
6
- - `public-sans-latin-500-normal.woff`
7
- - `public-sans-latin-600-normal.woff`
8
- - `public-sans-latin-700-normal.woff`
9
-
10
- They are renamed to the convention expected by the Nuxt Fonts local provider.
11
- The upstream package is available at <https://fontsource.org/fonts/public-sans>.
12
- Public Sans is licensed under the SIL Open Font License 1.1; see `LICENSE`.