@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.
- package/CHANGELOG.md +141 -0
- package/LICENSE +1 -1
- package/README.md +300 -53
- package/app/app.config.ts +44 -55
- package/app/assets/docs.css +619 -0
- package/app/components/DocsBanner.vue +29 -0
- package/app/components/DocsExample.vue +43 -0
- package/app/components/DocsFooter.vue +19 -0
- package/app/components/DocsHeader.vue +113 -0
- package/app/components/DocsIcon.vue +12 -0
- package/app/components/DocsLanding.vue +58 -0
- package/app/components/DocsLanguage.vue +40 -0
- package/app/components/DocsNavSheet.vue +37 -0
- package/app/components/DocsNavTree.vue +38 -0
- package/app/components/DocsPage.vue +88 -0
- package/app/components/DocsPageActions.vue +47 -0
- package/app/components/DocsPageEnd.ts +12 -0
- package/app/components/DocsPost.vue +58 -0
- package/app/components/DocsSearch.vue +136 -0
- package/app/components/DocsShell.vue +36 -0
- package/app/components/DocsSidebar.vue +19 -0
- package/app/components/DocsSidebarEnd.ts +4 -0
- package/app/components/DocsTable.vue +11 -0
- package/app/components/DocsThemeToggle.vue +45 -0
- package/app/components/DocsToc.vue +73 -0
- package/app/composables/useDocs.ts +53 -0
- package/app/composables/useDocsBlog.ts +33 -0
- package/app/composables/useDocsCopy.ts +17 -0
- package/app/composables/useDocsFrame.ts +11 -0
- package/app/composables/useDocsPopover.ts +36 -0
- package/app/composables/useDocsSite.ts +31 -0
- package/app/docs-pages/blog.vue +55 -0
- package/app/docs-pages/changelog.vue +35 -0
- package/app/docs-pages/doc.vue +16 -0
- package/app/docs-pages/docs.vue +9 -0
- package/app/docs-pages/index.vue +12 -0
- package/app/docs-pages/post.vue +8 -0
- package/app/error.vue +38 -115
- package/app/layouts/default.vue +29 -7
- package/app/lib/blogTypes.ts +8 -0
- package/app/lib/docsFirst.ts +11 -0
- package/app/lib/docsInit.ts +18 -0
- package/app/lib/docsNav.ts +36 -0
- package/app/lib/docsPage.ts +84 -0
- package/app/lib/markdownComponents.ts +15 -0
- package/app/lib/previewToc.ts +18 -0
- package/dist/config.d.mts +252 -0
- package/dist/config.d.ts +252 -0
- package/dist/config.mjs +83 -0
- package/dist/icons.d.mts +38 -0
- package/dist/icons.d.ts +38 -0
- package/dist/icons.mjs +175 -0
- package/dist/pages.d.mts +5 -0
- package/dist/pages.d.ts +5 -0
- package/dist/pages.mjs +68 -0
- package/i18n/de.json +1 -0
- package/i18n/en.json +1 -0
- package/i18n/fr.json +1 -0
- package/icons/README.md +2 -0
- package/icons/bluesky.svg +1 -0
- package/icons/claude.svg +1 -0
- package/icons/discord.svg +1 -0
- package/icons/github.svg +1 -0
- package/icons/linkedin.svg +1 -0
- package/icons/mastodon.svg +1 -0
- package/icons/openai.svg +1 -0
- package/icons/x.svg +1 -0
- package/icons/youtube.svg +1 -0
- package/nuxt.config.ts +22 -212
- package/package.json +44 -76
- package/public/_docs/fonts/LICENSE +188 -0
- package/public/_docs/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/public/_docs/fonts/jetbrains-mono-latin-400-normal.woff2 +0 -0
- package/public/_docs/fonts/jetbrains-mono-latin-500-normal.woff2 +0 -0
- package/server/feeds/blog-locale.get.ts +9 -0
- package/server/feeds/blog.get.ts +4 -0
- package/server/lib/blogFeed.ts +35 -0
- package/server/mcp/handler.ts +108 -0
- package/server/routes/__ginko/docs-mcp.ts +35 -0
- package/shared/layerRoutes.ts +66 -0
- package/shared/paths.ts +4 -0
- package/app/app.vue +0 -98
- package/app/assets/css/prose.css +0 -3240
- package/app/assets/css/tailwind.css +0 -394
- package/app/assets/css/theme-palettes.css +0 -309
- package/app/assets/css/theme-presets.css +0 -141
- package/app/components/OgImage/GinkoDocs.satori.vue +0 -238
- package/app/components/content/DocumentPageShell.vue +0 -55
- package/app/components/content/Feedback.vue +0 -102
- package/app/components/content/ImageZoomDialog.vue +0 -84
- package/app/components/content/PageMarkdownCopy.vue +0 -104
- package/app/components/content/imageZoom.ts +0 -25
- package/app/components/mdc/MdcAccordion.vue +0 -67
- package/app/components/mdc/MdcAccordionItem.vue +0 -42
- package/app/components/mdc/MdcApi.vue +0 -159
- package/app/components/mdc/MdcAside.vue +0 -23
- package/app/components/mdc/MdcCallout.vue +0 -61
- package/app/components/mdc/MdcCard.vue +0 -175
- package/app/components/mdc/MdcCards.vue +0 -30
- package/app/components/mdc/MdcCenter.vue +0 -71
- package/app/components/mdc/MdcCodeGroup.vue +0 -197
- package/app/components/mdc/MdcCodeTree.vue +0 -234
- package/app/components/mdc/MdcCollapse.vue +0 -61
- package/app/components/mdc/MdcColumn.vue +0 -70
- package/app/components/mdc/MdcDropcap.vue +0 -84
- package/app/components/mdc/MdcError.vue +0 -23
- package/app/components/mdc/MdcExcerpt.vue +0 -26
- package/app/components/mdc/MdcFigure.vue +0 -85
- package/app/components/mdc/MdcFiles.vue +0 -120
- package/app/components/mdc/MdcIdea.vue +0 -17
- package/app/components/mdc/MdcInfo.vue +0 -17
- package/app/components/mdc/MdcInlineToc.vue +0 -51
- package/app/components/mdc/MdcKbd.vue +0 -10
- package/app/components/mdc/MdcLayout.vue +0 -57
- package/app/components/mdc/MdcNote.vue +0 -17
- package/app/components/mdc/MdcQuiz.vue +0 -241
- package/app/components/mdc/MdcQuizQuestion.vue +0 -221
- package/app/components/mdc/MdcReadMore.vue +0 -70
- package/app/components/mdc/MdcSteps.vue +0 -59
- package/app/components/mdc/MdcSuccess.vue +0 -23
- package/app/components/mdc/MdcTab.vue +0 -17
- package/app/components/mdc/MdcTabs.vue +0 -150
- package/app/components/mdc/MdcTimeline.vue +0 -17
- package/app/components/mdc/MdcTimelineItem.vue +0 -40
- package/app/components/mdc/MdcWarning.vue +0 -23
- package/app/components/mdc/api.utils.ts +0 -132
- package/app/components/mdc/code-tree.utils.ts +0 -22
- package/app/components/mdc/icons.ts +0 -10
- package/app/components/mdc/quiz.utils.ts +0 -38
- package/app/components/prose/ProseA.vue +0 -27
- package/app/components/prose/ProseBlockquote.vue +0 -30
- package/app/components/prose/ProseCode.vue +0 -14
- package/app/components/prose/ProseEm.vue +0 -14
- package/app/components/prose/ProseH1.vue +0 -18
- package/app/components/prose/ProseH2.vue +0 -29
- package/app/components/prose/ProseH3.vue +0 -29
- package/app/components/prose/ProseH4.vue +0 -29
- package/app/components/prose/ProseH5.vue +0 -15
- package/app/components/prose/ProseH6.vue +0 -15
- package/app/components/prose/ProseHr.vue +0 -12
- package/app/components/prose/ProseImg.vue +0 -55
- package/app/components/prose/ProseLi.vue +0 -14
- package/app/components/prose/ProseOl.vue +0 -14
- package/app/components/prose/ProseP.vue +0 -14
- package/app/components/prose/ProsePre.vue +0 -180
- package/app/components/prose/ProseStrong.vue +0 -14
- package/app/components/prose/ProseTable.vue +0 -18
- package/app/components/prose/ProseTbody.vue +0 -14
- package/app/components/prose/ProseTd.vue +0 -14
- package/app/components/prose/ProseTh.vue +0 -14
- package/app/components/prose/ProseThead.vue +0 -14
- package/app/components/prose/ProseTr.vue +0 -14
- package/app/components/prose/ProseUl.vue +0 -14
- package/app/components/site/ModeToggle.vue +0 -81
- package/app/components/site/SiteBanner.vue +0 -97
- package/app/components/site/SiteFooter.vue +0 -90
- package/app/components/site/SiteHeader.vue +0 -371
- package/app/components/site/SiteHeroCode.vue +0 -173
- package/app/components/site/SiteInteractionLayer.vue +0 -42
- package/app/components/site/SiteLocaleSwitcher.vue +0 -190
- package/app/components/site/SiteLogoMark.vue +0 -12
- package/app/components/site/SiteSkipLink.vue +0 -14
- package/app/components/site/SiteSocialLinks.vue +0 -33
- package/app/components/site/header-utils.ts +0 -3
- package/app/components/site/mode-toggle.utils.ts +0 -18
- package/app/components/ui/badge/Badge.vue +0 -28
- package/app/components/ui/badge/index.ts +0 -24
- package/app/components/ui/button/Button.vue +0 -31
- package/app/components/ui/button/index.ts +0 -35
- package/app/components/ui/collapsible/Collapsible.vue +0 -15
- package/app/components/ui/collapsible/CollapsibleContent.vue +0 -25
- package/app/components/ui/collapsible/CollapsibleTrigger.vue +0 -12
- package/app/components/ui/collapsible/index.ts +0 -3
- package/app/components/ui/dropdown-menu/DropdownMenu.vue +0 -15
- package/app/components/ui/dropdown-menu/DropdownMenuContent.vue +0 -50
- package/app/components/ui/dropdown-menu/DropdownMenuItem.vue +0 -41
- package/app/components/ui/dropdown-menu/DropdownMenuRadioGroup.vue +0 -15
- package/app/components/ui/dropdown-menu/DropdownMenuRadioItem.vue +0 -37
- package/app/components/ui/dropdown-menu/DropdownMenuSeparator.vue +0 -23
- package/app/components/ui/dropdown-menu/DropdownMenuTrigger.vue +0 -14
- package/app/components/ui/dropdown-menu/index.ts +0 -7
- package/app/components/ui/kbd/Kbd.vue +0 -23
- package/app/components/ui/kbd/index.ts +0 -21
- package/app/components/ui/scroll-area/ScrollArea.vue +0 -39
- package/app/components/ui/scroll-area/ScrollBar.vue +0 -33
- package/app/components/ui/scroll-area/index.ts +0 -2
- package/app/components/ui/separator/Separator.vue +0 -27
- package/app/components/ui/separator/index.ts +0 -1
- package/app/components/ui/sheet/Sheet.vue +0 -15
- package/app/components/ui/sheet/SheetContent.vue +0 -59
- package/app/components/ui/sheet/SheetDescription.vue +0 -21
- package/app/components/ui/sheet/SheetOverlay.vue +0 -26
- package/app/components/ui/sheet/SheetTitle.vue +0 -21
- package/app/components/ui/sheet/SheetTrigger.vue +0 -12
- package/app/components/ui/sheet/index.ts +0 -5
- package/app/components/ui/tabs/Tabs.vue +0 -24
- package/app/components/ui/tabs/TabsList.vue +0 -26
- package/app/components/ui/tabs/TabsTrigger.vue +0 -28
- package/app/components/ui/tabs/index.ts +0 -3
- package/app/composables/site-navigation.utils.ts +0 -133
- package/app/composables/useCanonicalUrl.ts +0 -9
- package/app/composables/useContentRouteAlternates.ts +0 -35
- package/app/composables/useGinkoAnalytics.ts +0 -52
- package/app/composables/useGinkoDocsConfig.ts +0 -6
- package/app/composables/useGinkoOgImage.ts +0 -20
- package/app/composables/useLocalizedPath.ts +0 -12
- package/app/composables/useLocalizedRouteSwitch.ts +0 -31
- package/app/composables/useMetaKey.ts +0 -18
- package/app/composables/usePageMarkdownActions.ts +0 -79
- package/app/composables/useProseAppearance.ts +0 -24
- package/app/composables/useSchemaJsonLd.ts +0 -25
- package/app/composables/useSiteNavigation.ts +0 -64
- package/app/config/site.utils.ts +0 -36
- package/app/features/docs/components/DocsBreadcrumb.vue +0 -37
- package/app/features/docs/components/DocsContributeLinks.vue +0 -75
- package/app/features/docs/components/DocsMobileToc.vue +0 -108
- package/app/features/docs/components/DocsPageContent.vue +0 -234
- package/app/features/docs/components/DocsPageNav.vue +0 -57
- package/app/features/docs/components/DocsSidebar.vue +0 -145
- package/app/features/docs/components/DocsSidebarDropdown.vue +0 -70
- package/app/features/docs/components/DocsSidebarItem.vue +0 -122
- package/app/features/docs/components/DocsSidebarList.vue +0 -35
- package/app/features/docs/components/DocsSidebarRow.vue +0 -27
- package/app/features/docs/components/DocsSidebarTabs.vue +0 -59
- package/app/features/docs/components/DocsToc.vue +0 -106
- package/app/features/docs/composables/useDocsNavigation.ts +0 -29
- package/app/features/docs/composables/useDocsNavigationData.ts +0 -18
- package/app/features/docs/composables/useRevealActive.ts +0 -58
- package/app/features/docs/composables/useScrollspy.ts +0 -135
- package/app/features/docs/docs-navigation.ts +0 -157
- package/app/features/docs/toc-context.ts +0 -6
- package/app/features/search/command-center.ts +0 -110
- package/app/features/search/components/SiteCommandCenter.vue +0 -359
- package/app/features/search/components/SiteSearchPageHighlight.vue +0 -126
- package/app/features/search/useCommandCenter.ts +0 -292
- package/app/layouts/blog.vue +0 -15
- package/app/layouts/docs.vue +0 -20
- package/app/lib/errors.ts +0 -37
- package/app/lib/schema-org.ts +0 -38
- package/app/pages/blog/[slug].vue +0 -228
- package/app/pages/blog/index.vue +0 -130
- package/app/pages/docs/[...slug].vue +0 -10
- package/app/pages/docs/index.vue +0 -19
- package/app/pages/index.vue +0 -278
- package/app/plugins/ginko-docs-theme.ts +0 -14
- package/app/plugins/ssr-width.ts +0 -6
- package/app/utils/content.ts +0 -67
- package/app/utils/file-icons.ts +0 -90
- package/app/utils/index.ts +0 -7
- package/app/utils/repository.ts +0 -20
- package/components.ts +0 -9
- package/content-collections.ts +0 -89
- package/content.js +0 -200
- package/content.ts +0 -104
- package/i18n/i18n.config.ts +0 -10
- package/i18n/locales.ts +0 -81
- package/i18n/messages/global/banner.ts +0 -8
- package/i18n/messages/global/blog.ts +0 -18
- package/i18n/messages/global/command.ts +0 -49
- package/i18n/messages/global/docs.ts +0 -36
- package/i18n/messages/global/errors.ts +0 -36
- package/i18n/messages/global/feedback.ts +0 -11
- package/i18n/messages/global/index.ts +0 -21
- package/i18n/messages/global/nav.ts +0 -26
- package/i18n/messages/global/site.ts +0 -4
- package/i18n/messages/global/theme.ts +0 -9
- package/i18n/messages/index.ts +0 -20
- package/i18n/messages/localize.ts +0 -35
- package/i18n/routes.ts +0 -33
- package/icon-bundle.ts +0 -116
- package/index.d.ts +0 -37
- package/modules/analytics-boundary.ts +0 -23
- package/modules/feature-routing.ts +0 -68
- package/modules/syntax-highlighting.ts +0 -120
- package/public/fonts/public-sans/LICENSE +0 -93
- package/public/fonts/public-sans/README.md +0 -12
- package/public/fonts/public-sans/public-sans-400-normal-latin.woff +0 -0
- package/public/fonts/public-sans/public-sans-500-normal-latin.woff +0 -0
- package/public/fonts/public-sans/public-sans-600-normal-latin.woff +0 -0
- package/public/fonts/public-sans/public-sans-700-normal-latin.woff +0 -0
- package/runtime/generate-favicons.mjs +0 -124
- package/runtime/server/agent-markdown.ts +0 -19
- package/server/api/_ginko-docs/redirects.get.ts +0 -28
- package/server/mcp/tools/get-page.ts +0 -14
- package/server/mcp/tools/list-pages.ts +0 -10
- package/server/middleware/redirects.ts +0 -22
- package/server/plugins/agent-markdown.ts +0 -6
- package/server/plugins/sitemap-policy.ts +0 -12
- package/server/routes/.well-known/ai-catalog.json.get.ts +0 -10
- package/server/routes/[locale]/blog/rss.xml.get.ts +0 -13
- package/server/routes/blog/rss.xml.get.ts +0 -5
- package/server/routes/mcp/server-card.get.ts +0 -14
- package/server/utils/blog-feed.ts +0 -51
- package/server/utils/feed.ts +0 -70
- package/server/utils/mcp-server-card.ts +0 -45
- package/server/utils/redirects.ts +0 -38
- package/server/utils/redirects.utils.ts +0 -58
- package/server/utils/sitemap.ts +0 -45
- package/shared/route-slugs.ts +0 -5
- package/shared/theme-palettes.ts +0 -37
- package/shared/theme-presets.ts +0 -3
- package/shared/types/app-config.ts +0 -172
- package/shared/types/nuxt-config.ts +0 -14
- package/tags.ts +0 -192
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import * as _lupinum_ginko from '@lupinum/ginko';
|
|
2
|
+
import { BrickSource, Locale } from '@lupinum/ginko';
|
|
3
|
+
import * as _lupinum_ginko_internal from '@lupinum/ginko/internal';
|
|
4
|
+
export { components } from '@lupinum/ginko-components/registry';
|
|
5
|
+
|
|
6
|
+
/** The site's locales, main locale first. The same list as `locales` in `defineSite`, as a plain array or a tuple. */
|
|
7
|
+
type Locales = readonly Locale[];
|
|
8
|
+
/**
|
|
9
|
+
* Where a brick's content comes from: `'files'` (the default) reads Markdown from `content/`, `'platform'` keeps it on
|
|
10
|
+
* the Ginko platform, where people edit it in Ginko Studio. Unlike the bricks of `@lupinum/ginko/basics`, docs bricks
|
|
11
|
+
* read files unless they are told otherwise: docs usually live in Git.
|
|
12
|
+
*/
|
|
13
|
+
type DocsSource = BrickSource | 'platform';
|
|
14
|
+
/** `base`: where the docs live, default `/docs` (e.g. `/handbook` inside a larger site). `source`: see `DocsSource`. */
|
|
15
|
+
declare function docsCollection(opts: {
|
|
16
|
+
locales: Locales;
|
|
17
|
+
label?: string;
|
|
18
|
+
max?: number;
|
|
19
|
+
base?: `/${string}`;
|
|
20
|
+
source?: DocsSource;
|
|
21
|
+
}): _lupinum_ginko.CollectionBrick<{
|
|
22
|
+
readonly title: _lupinum_ginko_internal.TextField & Omit<_lupinum_ginko_internal.TextField, "type" | "label" | "pos" | "retired" | "default"> & {
|
|
23
|
+
default?: (string | Partial<Record<string, string>>) | undefined;
|
|
24
|
+
};
|
|
25
|
+
readonly description: _lupinum_ginko_internal.LongTextField & {
|
|
26
|
+
readonly optional: true;
|
|
27
|
+
};
|
|
28
|
+
/** Starts a group in the side navigation under this heading; the pages after it belong to it until the next one. */
|
|
29
|
+
readonly section: _lupinum_ginko_internal.TextField & {
|
|
30
|
+
readonly optional: true;
|
|
31
|
+
};
|
|
32
|
+
/** Nests the entry under another doc in the side navigation and the breadcrumbs. */
|
|
33
|
+
readonly parent: _lupinum_ginko_internal.RefField & {
|
|
34
|
+
multiple?: false;
|
|
35
|
+
} & {
|
|
36
|
+
readonly to: "docs";
|
|
37
|
+
readonly optional: true;
|
|
38
|
+
};
|
|
39
|
+
/** Section tab above the side navigation; a page without one follows the tab of the page before it. Children follow their parent. */
|
|
40
|
+
readonly tab: _lupinum_ginko_internal.TextField & {
|
|
41
|
+
readonly optional: true;
|
|
42
|
+
readonly max: 30;
|
|
43
|
+
};
|
|
44
|
+
/** A short label next to the entry in the side navigation, e.g. "New". */
|
|
45
|
+
readonly badge: _lupinum_ginko_internal.TextField & {
|
|
46
|
+
readonly optional: true;
|
|
47
|
+
readonly max: 20;
|
|
48
|
+
};
|
|
49
|
+
/** An icon name such as `lucide:book-open` (any installed Iconify set), shown before the title in the side navigation. */
|
|
50
|
+
readonly icon: _lupinum_ginko_internal.TextField & {
|
|
51
|
+
readonly optional: true;
|
|
52
|
+
readonly max: 60;
|
|
53
|
+
readonly translate: false;
|
|
54
|
+
};
|
|
55
|
+
readonly slug: _lupinum_ginko_internal.SlugField & {
|
|
56
|
+
readonly from: "title";
|
|
57
|
+
};
|
|
58
|
+
readonly body: _lupinum_ginko_internal.MarkdownField & {
|
|
59
|
+
readonly profile: "page";
|
|
60
|
+
};
|
|
61
|
+
}, Record<string, `/${string}/[slug]`>>;
|
|
62
|
+
/**
|
|
63
|
+
* The optional start page: one Markdown file `content/home[.<locale>].md`. The frontmatter fills the hero (title,
|
|
64
|
+
* description, install command, up to two links) and the feature grid; the text below the frontmatter follows them and
|
|
65
|
+
* may use every component. Without it, `/` opens the first docs page. Add `home: homePages({ locales })` to `pages`.
|
|
66
|
+
* `source`: see `DocsSource`.
|
|
67
|
+
*/
|
|
68
|
+
declare function docsHome(opts?: {
|
|
69
|
+
source?: DocsSource;
|
|
70
|
+
}): _lupinum_ginko.SingleBrick<{
|
|
71
|
+
readonly title: _lupinum_ginko_internal.TextField & {
|
|
72
|
+
readonly max: 120;
|
|
73
|
+
};
|
|
74
|
+
readonly description: _lupinum_ginko_internal.LongTextField & {
|
|
75
|
+
readonly optional: true;
|
|
76
|
+
readonly max: 400;
|
|
77
|
+
};
|
|
78
|
+
/** A command shown with a copy button, e.g. `pnpm add @lupinum/ginko`. */
|
|
79
|
+
readonly install: _lupinum_ginko_internal.TextField & {
|
|
80
|
+
readonly optional: true;
|
|
81
|
+
readonly max: 200;
|
|
82
|
+
readonly translate: false;
|
|
83
|
+
};
|
|
84
|
+
/** Buttons under the description; the first one is the main one. */
|
|
85
|
+
readonly links: _lupinum_ginko_internal.ListField<{
|
|
86
|
+
readonly label: _lupinum_ginko_internal.TextField & {
|
|
87
|
+
readonly max: 40;
|
|
88
|
+
};
|
|
89
|
+
readonly href: _lupinum_ginko_internal.TextField & {
|
|
90
|
+
readonly max: 300;
|
|
91
|
+
};
|
|
92
|
+
}> & Omit<{
|
|
93
|
+
readonly itemLabel: "Link";
|
|
94
|
+
readonly fields: {
|
|
95
|
+
readonly label: _lupinum_ginko_internal.TextField & {
|
|
96
|
+
readonly max: 40;
|
|
97
|
+
};
|
|
98
|
+
readonly href: _lupinum_ginko_internal.TextField & {
|
|
99
|
+
readonly max: 300;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
readonly max: 2;
|
|
103
|
+
readonly default: readonly [];
|
|
104
|
+
}, "fields">;
|
|
105
|
+
readonly features: _lupinum_ginko_internal.ListField<{
|
|
106
|
+
readonly icon: _lupinum_ginko_internal.TextField & {
|
|
107
|
+
readonly optional: true;
|
|
108
|
+
readonly max: 60;
|
|
109
|
+
readonly translate: false;
|
|
110
|
+
};
|
|
111
|
+
readonly title: _lupinum_ginko_internal.TextField & {
|
|
112
|
+
readonly max: 80;
|
|
113
|
+
};
|
|
114
|
+
readonly description: _lupinum_ginko_internal.LongTextField & {
|
|
115
|
+
readonly max: 300;
|
|
116
|
+
};
|
|
117
|
+
readonly href: _lupinum_ginko_internal.TextField & {
|
|
118
|
+
readonly optional: true;
|
|
119
|
+
readonly max: 300;
|
|
120
|
+
};
|
|
121
|
+
}> & Omit<{
|
|
122
|
+
readonly itemLabel: "Feature";
|
|
123
|
+
readonly fields: {
|
|
124
|
+
readonly icon: _lupinum_ginko_internal.TextField & {
|
|
125
|
+
readonly optional: true;
|
|
126
|
+
readonly max: 60;
|
|
127
|
+
readonly translate: false;
|
|
128
|
+
};
|
|
129
|
+
readonly title: _lupinum_ginko_internal.TextField & {
|
|
130
|
+
readonly max: 80;
|
|
131
|
+
};
|
|
132
|
+
readonly description: _lupinum_ginko_internal.LongTextField & {
|
|
133
|
+
readonly max: 300;
|
|
134
|
+
};
|
|
135
|
+
readonly href: _lupinum_ginko_internal.TextField & {
|
|
136
|
+
readonly optional: true;
|
|
137
|
+
readonly max: 300;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
readonly max: 12;
|
|
141
|
+
readonly default: readonly [];
|
|
142
|
+
}, "fields">;
|
|
143
|
+
readonly body: _lupinum_ginko_internal.MarkdownField & {
|
|
144
|
+
readonly profile: "page";
|
|
145
|
+
readonly optional: true;
|
|
146
|
+
};
|
|
147
|
+
}>;
|
|
148
|
+
/**
|
|
149
|
+
* The optional blog: `{ posts, authors }`, spread into `bricks` in ginko.config.ts. Posts live at
|
|
150
|
+
* /blog/<slug> (main locale unprefixed, `/<l>/blog/<slug>` otherwise) and come out newest first.
|
|
151
|
+
* Authors have no page; a post names them in `authors`. Files: `content/posts/<n>.<name>[.<locale>].md`
|
|
152
|
+
* and `content/authors/<name>[.<locale>].yml`. Add `blog: blogPages({ locales })` to `pages` as well.
|
|
153
|
+
* The bricks are `posts()` and `authors()` of `@lupinum/ginko/basics` with the English labels docs sites store.
|
|
154
|
+
* `source` (both bricks): see `DocsSource`.
|
|
155
|
+
*/
|
|
156
|
+
declare function blogCollections(opts: {
|
|
157
|
+
locales: Locales;
|
|
158
|
+
max?: number;
|
|
159
|
+
source?: DocsSource;
|
|
160
|
+
}): {
|
|
161
|
+
posts: _lupinum_ginko.CollectionBrick<{
|
|
162
|
+
readonly title: _lupinum_ginko_internal.TextField & Omit<_lupinum_ginko_internal.TextField, "type" | "label" | "pos" | "retired" | "default"> & {
|
|
163
|
+
default?: (string | Partial<Record<string, string>>) | undefined;
|
|
164
|
+
};
|
|
165
|
+
readonly description: _lupinum_ginko_internal.LongTextField & {
|
|
166
|
+
readonly optional: true;
|
|
167
|
+
};
|
|
168
|
+
readonly date: _lupinum_ginko_internal.DateField & Omit<_lupinum_ginko_internal.DateField, "type" | "label" | "pos" | "retired" | "default"> & {
|
|
169
|
+
default?: string | undefined;
|
|
170
|
+
};
|
|
171
|
+
readonly authors: _lupinum_ginko_internal.RefField & {
|
|
172
|
+
multiple: true;
|
|
173
|
+
} & {
|
|
174
|
+
readonly to: string;
|
|
175
|
+
readonly optional: true;
|
|
176
|
+
};
|
|
177
|
+
readonly image: _lupinum_ginko_internal.ImageField & {
|
|
178
|
+
readonly optional: true;
|
|
179
|
+
};
|
|
180
|
+
readonly tags: _lupinum_ginko_internal.ListField<{
|
|
181
|
+
readonly tag: _lupinum_ginko_internal.TextField & {
|
|
182
|
+
readonly max: 40;
|
|
183
|
+
};
|
|
184
|
+
}> & Omit<{
|
|
185
|
+
readonly itemLabel: Record<string, string>;
|
|
186
|
+
readonly fields: {
|
|
187
|
+
readonly tag: _lupinum_ginko_internal.TextField & {
|
|
188
|
+
readonly max: 40;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
readonly max: 10;
|
|
192
|
+
readonly optional: true;
|
|
193
|
+
}, "fields">;
|
|
194
|
+
readonly slug: _lupinum_ginko_internal.SlugField & {
|
|
195
|
+
readonly from: "title";
|
|
196
|
+
};
|
|
197
|
+
readonly body: _lupinum_ginko_internal.MarkdownField & {
|
|
198
|
+
readonly profile: "page";
|
|
199
|
+
};
|
|
200
|
+
}, Record<string, "/blog/[slug]">>;
|
|
201
|
+
authors: _lupinum_ginko.CollectionBrick<{
|
|
202
|
+
readonly name: _lupinum_ginko_internal.TextField & Omit<_lupinum_ginko_internal.TextField, "type" | "label" | "pos" | "retired" | "default"> & {
|
|
203
|
+
default?: (string | Partial<Record<string, string>>) | undefined;
|
|
204
|
+
};
|
|
205
|
+
readonly role: _lupinum_ginko_internal.TextField & {
|
|
206
|
+
readonly optional: true;
|
|
207
|
+
};
|
|
208
|
+
readonly avatar: _lupinum_ginko_internal.ImageField & {
|
|
209
|
+
readonly optional: true;
|
|
210
|
+
};
|
|
211
|
+
readonly url: _lupinum_ginko_internal.TextField & {
|
|
212
|
+
readonly format: "url";
|
|
213
|
+
readonly optional: true;
|
|
214
|
+
};
|
|
215
|
+
}, undefined>;
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* The optional changelog: one page at /changelog with one entry per release, newest first. Entries have no
|
|
219
|
+
* page of their own, the page links to each by anchor. Files: `content/changelog/<name>[.<locale>].md`
|
|
220
|
+
* with `version` and `date` in the frontmatter (a dot in the name would read as a language: use `v1-2-0.md`). Add `changelog: changelogPages({ locales })` to `pages` as well.
|
|
221
|
+
* The brick is `changelog()` of `@lupinum/ginko/basics` with the English labels docs sites store. `source`: see
|
|
222
|
+
* `DocsSource`.
|
|
223
|
+
*/
|
|
224
|
+
declare function changelogCollection(opts?: {
|
|
225
|
+
max?: number;
|
|
226
|
+
source?: DocsSource;
|
|
227
|
+
}): _lupinum_ginko.CollectionBrick<{
|
|
228
|
+
readonly version: _lupinum_ginko_internal.TextField & {
|
|
229
|
+
readonly max: 40;
|
|
230
|
+
readonly translate: false;
|
|
231
|
+
};
|
|
232
|
+
readonly date: _lupinum_ginko_internal.DateField & Omit<_lupinum_ginko_internal.DateField, "type" | "label" | "pos" | "retired" | "default"> & {
|
|
233
|
+
default?: string | undefined;
|
|
234
|
+
};
|
|
235
|
+
readonly body: _lupinum_ginko_internal.MarkdownField & {
|
|
236
|
+
readonly profile: "page";
|
|
237
|
+
};
|
|
238
|
+
}, undefined>;
|
|
239
|
+
/** The start page by locale, for `pages` in ginko.config.ts: the main locale at `/`, the others at `/<locale>`. */
|
|
240
|
+
declare const homePages: (opts: {
|
|
241
|
+
locales: Locales;
|
|
242
|
+
}) => Record<string, "/">;
|
|
243
|
+
/** The list pages by locale, for `pages` in ginko.config.ts: the sitemap and the static build know them from there. */
|
|
244
|
+
declare const blogPages: (opts: {
|
|
245
|
+
locales: Locales;
|
|
246
|
+
}) => Record<string, "/blog">;
|
|
247
|
+
declare const changelogPages: (opts: {
|
|
248
|
+
locales: Locales;
|
|
249
|
+
}) => Record<string, "/changelog">;
|
|
250
|
+
|
|
251
|
+
export { blogCollections, blogPages, changelogCollection, changelogPages, docsCollection, docsHome, homePages };
|
|
252
|
+
export type { DocsSource };
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import * as _lupinum_ginko from '@lupinum/ginko';
|
|
2
|
+
import { BrickSource, Locale } from '@lupinum/ginko';
|
|
3
|
+
import * as _lupinum_ginko_internal from '@lupinum/ginko/internal';
|
|
4
|
+
export { components } from '@lupinum/ginko-components/registry';
|
|
5
|
+
|
|
6
|
+
/** The site's locales, main locale first. The same list as `locales` in `defineSite`, as a plain array or a tuple. */
|
|
7
|
+
type Locales = readonly Locale[];
|
|
8
|
+
/**
|
|
9
|
+
* Where a brick's content comes from: `'files'` (the default) reads Markdown from `content/`, `'platform'` keeps it on
|
|
10
|
+
* the Ginko platform, where people edit it in Ginko Studio. Unlike the bricks of `@lupinum/ginko/basics`, docs bricks
|
|
11
|
+
* read files unless they are told otherwise: docs usually live in Git.
|
|
12
|
+
*/
|
|
13
|
+
type DocsSource = BrickSource | 'platform';
|
|
14
|
+
/** `base`: where the docs live, default `/docs` (e.g. `/handbook` inside a larger site). `source`: see `DocsSource`. */
|
|
15
|
+
declare function docsCollection(opts: {
|
|
16
|
+
locales: Locales;
|
|
17
|
+
label?: string;
|
|
18
|
+
max?: number;
|
|
19
|
+
base?: `/${string}`;
|
|
20
|
+
source?: DocsSource;
|
|
21
|
+
}): _lupinum_ginko.CollectionBrick<{
|
|
22
|
+
readonly title: _lupinum_ginko_internal.TextField & Omit<_lupinum_ginko_internal.TextField, "type" | "label" | "pos" | "retired" | "default"> & {
|
|
23
|
+
default?: (string | Partial<Record<string, string>>) | undefined;
|
|
24
|
+
};
|
|
25
|
+
readonly description: _lupinum_ginko_internal.LongTextField & {
|
|
26
|
+
readonly optional: true;
|
|
27
|
+
};
|
|
28
|
+
/** Starts a group in the side navigation under this heading; the pages after it belong to it until the next one. */
|
|
29
|
+
readonly section: _lupinum_ginko_internal.TextField & {
|
|
30
|
+
readonly optional: true;
|
|
31
|
+
};
|
|
32
|
+
/** Nests the entry under another doc in the side navigation and the breadcrumbs. */
|
|
33
|
+
readonly parent: _lupinum_ginko_internal.RefField & {
|
|
34
|
+
multiple?: false;
|
|
35
|
+
} & {
|
|
36
|
+
readonly to: "docs";
|
|
37
|
+
readonly optional: true;
|
|
38
|
+
};
|
|
39
|
+
/** Section tab above the side navigation; a page without one follows the tab of the page before it. Children follow their parent. */
|
|
40
|
+
readonly tab: _lupinum_ginko_internal.TextField & {
|
|
41
|
+
readonly optional: true;
|
|
42
|
+
readonly max: 30;
|
|
43
|
+
};
|
|
44
|
+
/** A short label next to the entry in the side navigation, e.g. "New". */
|
|
45
|
+
readonly badge: _lupinum_ginko_internal.TextField & {
|
|
46
|
+
readonly optional: true;
|
|
47
|
+
readonly max: 20;
|
|
48
|
+
};
|
|
49
|
+
/** An icon name such as `lucide:book-open` (any installed Iconify set), shown before the title in the side navigation. */
|
|
50
|
+
readonly icon: _lupinum_ginko_internal.TextField & {
|
|
51
|
+
readonly optional: true;
|
|
52
|
+
readonly max: 60;
|
|
53
|
+
readonly translate: false;
|
|
54
|
+
};
|
|
55
|
+
readonly slug: _lupinum_ginko_internal.SlugField & {
|
|
56
|
+
readonly from: "title";
|
|
57
|
+
};
|
|
58
|
+
readonly body: _lupinum_ginko_internal.MarkdownField & {
|
|
59
|
+
readonly profile: "page";
|
|
60
|
+
};
|
|
61
|
+
}, Record<string, `/${string}/[slug]`>>;
|
|
62
|
+
/**
|
|
63
|
+
* The optional start page: one Markdown file `content/home[.<locale>].md`. The frontmatter fills the hero (title,
|
|
64
|
+
* description, install command, up to two links) and the feature grid; the text below the frontmatter follows them and
|
|
65
|
+
* may use every component. Without it, `/` opens the first docs page. Add `home: homePages({ locales })` to `pages`.
|
|
66
|
+
* `source`: see `DocsSource`.
|
|
67
|
+
*/
|
|
68
|
+
declare function docsHome(opts?: {
|
|
69
|
+
source?: DocsSource;
|
|
70
|
+
}): _lupinum_ginko.SingleBrick<{
|
|
71
|
+
readonly title: _lupinum_ginko_internal.TextField & {
|
|
72
|
+
readonly max: 120;
|
|
73
|
+
};
|
|
74
|
+
readonly description: _lupinum_ginko_internal.LongTextField & {
|
|
75
|
+
readonly optional: true;
|
|
76
|
+
readonly max: 400;
|
|
77
|
+
};
|
|
78
|
+
/** A command shown with a copy button, e.g. `pnpm add @lupinum/ginko`. */
|
|
79
|
+
readonly install: _lupinum_ginko_internal.TextField & {
|
|
80
|
+
readonly optional: true;
|
|
81
|
+
readonly max: 200;
|
|
82
|
+
readonly translate: false;
|
|
83
|
+
};
|
|
84
|
+
/** Buttons under the description; the first one is the main one. */
|
|
85
|
+
readonly links: _lupinum_ginko_internal.ListField<{
|
|
86
|
+
readonly label: _lupinum_ginko_internal.TextField & {
|
|
87
|
+
readonly max: 40;
|
|
88
|
+
};
|
|
89
|
+
readonly href: _lupinum_ginko_internal.TextField & {
|
|
90
|
+
readonly max: 300;
|
|
91
|
+
};
|
|
92
|
+
}> & Omit<{
|
|
93
|
+
readonly itemLabel: "Link";
|
|
94
|
+
readonly fields: {
|
|
95
|
+
readonly label: _lupinum_ginko_internal.TextField & {
|
|
96
|
+
readonly max: 40;
|
|
97
|
+
};
|
|
98
|
+
readonly href: _lupinum_ginko_internal.TextField & {
|
|
99
|
+
readonly max: 300;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
readonly max: 2;
|
|
103
|
+
readonly default: readonly [];
|
|
104
|
+
}, "fields">;
|
|
105
|
+
readonly features: _lupinum_ginko_internal.ListField<{
|
|
106
|
+
readonly icon: _lupinum_ginko_internal.TextField & {
|
|
107
|
+
readonly optional: true;
|
|
108
|
+
readonly max: 60;
|
|
109
|
+
readonly translate: false;
|
|
110
|
+
};
|
|
111
|
+
readonly title: _lupinum_ginko_internal.TextField & {
|
|
112
|
+
readonly max: 80;
|
|
113
|
+
};
|
|
114
|
+
readonly description: _lupinum_ginko_internal.LongTextField & {
|
|
115
|
+
readonly max: 300;
|
|
116
|
+
};
|
|
117
|
+
readonly href: _lupinum_ginko_internal.TextField & {
|
|
118
|
+
readonly optional: true;
|
|
119
|
+
readonly max: 300;
|
|
120
|
+
};
|
|
121
|
+
}> & Omit<{
|
|
122
|
+
readonly itemLabel: "Feature";
|
|
123
|
+
readonly fields: {
|
|
124
|
+
readonly icon: _lupinum_ginko_internal.TextField & {
|
|
125
|
+
readonly optional: true;
|
|
126
|
+
readonly max: 60;
|
|
127
|
+
readonly translate: false;
|
|
128
|
+
};
|
|
129
|
+
readonly title: _lupinum_ginko_internal.TextField & {
|
|
130
|
+
readonly max: 80;
|
|
131
|
+
};
|
|
132
|
+
readonly description: _lupinum_ginko_internal.LongTextField & {
|
|
133
|
+
readonly max: 300;
|
|
134
|
+
};
|
|
135
|
+
readonly href: _lupinum_ginko_internal.TextField & {
|
|
136
|
+
readonly optional: true;
|
|
137
|
+
readonly max: 300;
|
|
138
|
+
};
|
|
139
|
+
};
|
|
140
|
+
readonly max: 12;
|
|
141
|
+
readonly default: readonly [];
|
|
142
|
+
}, "fields">;
|
|
143
|
+
readonly body: _lupinum_ginko_internal.MarkdownField & {
|
|
144
|
+
readonly profile: "page";
|
|
145
|
+
readonly optional: true;
|
|
146
|
+
};
|
|
147
|
+
}>;
|
|
148
|
+
/**
|
|
149
|
+
* The optional blog: `{ posts, authors }`, spread into `bricks` in ginko.config.ts. Posts live at
|
|
150
|
+
* /blog/<slug> (main locale unprefixed, `/<l>/blog/<slug>` otherwise) and come out newest first.
|
|
151
|
+
* Authors have no page; a post names them in `authors`. Files: `content/posts/<n>.<name>[.<locale>].md`
|
|
152
|
+
* and `content/authors/<name>[.<locale>].yml`. Add `blog: blogPages({ locales })` to `pages` as well.
|
|
153
|
+
* The bricks are `posts()` and `authors()` of `@lupinum/ginko/basics` with the English labels docs sites store.
|
|
154
|
+
* `source` (both bricks): see `DocsSource`.
|
|
155
|
+
*/
|
|
156
|
+
declare function blogCollections(opts: {
|
|
157
|
+
locales: Locales;
|
|
158
|
+
max?: number;
|
|
159
|
+
source?: DocsSource;
|
|
160
|
+
}): {
|
|
161
|
+
posts: _lupinum_ginko.CollectionBrick<{
|
|
162
|
+
readonly title: _lupinum_ginko_internal.TextField & Omit<_lupinum_ginko_internal.TextField, "type" | "label" | "pos" | "retired" | "default"> & {
|
|
163
|
+
default?: (string | Partial<Record<string, string>>) | undefined;
|
|
164
|
+
};
|
|
165
|
+
readonly description: _lupinum_ginko_internal.LongTextField & {
|
|
166
|
+
readonly optional: true;
|
|
167
|
+
};
|
|
168
|
+
readonly date: _lupinum_ginko_internal.DateField & Omit<_lupinum_ginko_internal.DateField, "type" | "label" | "pos" | "retired" | "default"> & {
|
|
169
|
+
default?: string | undefined;
|
|
170
|
+
};
|
|
171
|
+
readonly authors: _lupinum_ginko_internal.RefField & {
|
|
172
|
+
multiple: true;
|
|
173
|
+
} & {
|
|
174
|
+
readonly to: string;
|
|
175
|
+
readonly optional: true;
|
|
176
|
+
};
|
|
177
|
+
readonly image: _lupinum_ginko_internal.ImageField & {
|
|
178
|
+
readonly optional: true;
|
|
179
|
+
};
|
|
180
|
+
readonly tags: _lupinum_ginko_internal.ListField<{
|
|
181
|
+
readonly tag: _lupinum_ginko_internal.TextField & {
|
|
182
|
+
readonly max: 40;
|
|
183
|
+
};
|
|
184
|
+
}> & Omit<{
|
|
185
|
+
readonly itemLabel: Record<string, string>;
|
|
186
|
+
readonly fields: {
|
|
187
|
+
readonly tag: _lupinum_ginko_internal.TextField & {
|
|
188
|
+
readonly max: 40;
|
|
189
|
+
};
|
|
190
|
+
};
|
|
191
|
+
readonly max: 10;
|
|
192
|
+
readonly optional: true;
|
|
193
|
+
}, "fields">;
|
|
194
|
+
readonly slug: _lupinum_ginko_internal.SlugField & {
|
|
195
|
+
readonly from: "title";
|
|
196
|
+
};
|
|
197
|
+
readonly body: _lupinum_ginko_internal.MarkdownField & {
|
|
198
|
+
readonly profile: "page";
|
|
199
|
+
};
|
|
200
|
+
}, Record<string, "/blog/[slug]">>;
|
|
201
|
+
authors: _lupinum_ginko.CollectionBrick<{
|
|
202
|
+
readonly name: _lupinum_ginko_internal.TextField & Omit<_lupinum_ginko_internal.TextField, "type" | "label" | "pos" | "retired" | "default"> & {
|
|
203
|
+
default?: (string | Partial<Record<string, string>>) | undefined;
|
|
204
|
+
};
|
|
205
|
+
readonly role: _lupinum_ginko_internal.TextField & {
|
|
206
|
+
readonly optional: true;
|
|
207
|
+
};
|
|
208
|
+
readonly avatar: _lupinum_ginko_internal.ImageField & {
|
|
209
|
+
readonly optional: true;
|
|
210
|
+
};
|
|
211
|
+
readonly url: _lupinum_ginko_internal.TextField & {
|
|
212
|
+
readonly format: "url";
|
|
213
|
+
readonly optional: true;
|
|
214
|
+
};
|
|
215
|
+
}, undefined>;
|
|
216
|
+
};
|
|
217
|
+
/**
|
|
218
|
+
* The optional changelog: one page at /changelog with one entry per release, newest first. Entries have no
|
|
219
|
+
* page of their own, the page links to each by anchor. Files: `content/changelog/<name>[.<locale>].md`
|
|
220
|
+
* with `version` and `date` in the frontmatter (a dot in the name would read as a language: use `v1-2-0.md`). Add `changelog: changelogPages({ locales })` to `pages` as well.
|
|
221
|
+
* The brick is `changelog()` of `@lupinum/ginko/basics` with the English labels docs sites store. `source`: see
|
|
222
|
+
* `DocsSource`.
|
|
223
|
+
*/
|
|
224
|
+
declare function changelogCollection(opts?: {
|
|
225
|
+
max?: number;
|
|
226
|
+
source?: DocsSource;
|
|
227
|
+
}): _lupinum_ginko.CollectionBrick<{
|
|
228
|
+
readonly version: _lupinum_ginko_internal.TextField & {
|
|
229
|
+
readonly max: 40;
|
|
230
|
+
readonly translate: false;
|
|
231
|
+
};
|
|
232
|
+
readonly date: _lupinum_ginko_internal.DateField & Omit<_lupinum_ginko_internal.DateField, "type" | "label" | "pos" | "retired" | "default"> & {
|
|
233
|
+
default?: string | undefined;
|
|
234
|
+
};
|
|
235
|
+
readonly body: _lupinum_ginko_internal.MarkdownField & {
|
|
236
|
+
readonly profile: "page";
|
|
237
|
+
};
|
|
238
|
+
}, undefined>;
|
|
239
|
+
/** The start page by locale, for `pages` in ginko.config.ts: the main locale at `/`, the others at `/<locale>`. */
|
|
240
|
+
declare const homePages: (opts: {
|
|
241
|
+
locales: Locales;
|
|
242
|
+
}) => Record<string, "/">;
|
|
243
|
+
/** The list pages by locale, for `pages` in ginko.config.ts: the sitemap and the static build know them from there. */
|
|
244
|
+
declare const blogPages: (opts: {
|
|
245
|
+
locales: Locales;
|
|
246
|
+
}) => Record<string, "/blog">;
|
|
247
|
+
declare const changelogPages: (opts: {
|
|
248
|
+
locales: Locales;
|
|
249
|
+
}) => Record<string, "/changelog">;
|
|
250
|
+
|
|
251
|
+
export { blogCollections, blogPages, changelogCollection, changelogPages, docsCollection, docsHome, homePages };
|
|
252
|
+
export type { DocsSource };
|
package/dist/config.mjs
ADDED
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { collection, f, single } from '@lupinum/ginko';
|
|
2
|
+
import { authors, posts, changelog } from '@lupinum/ginko/basics';
|
|
3
|
+
import { labelsIn } from '@lupinum/ginko/internal';
|
|
4
|
+
export { components } from '@lupinum/ginko-components/registry';
|
|
5
|
+
|
|
6
|
+
const BLOG_PATH = "/blog";
|
|
7
|
+
const CHANGELOG_PATH = "/changelog";
|
|
8
|
+
|
|
9
|
+
const sourceOf = (source = "files") => source === "files" ? { source } : {};
|
|
10
|
+
function localized(locales, path) {
|
|
11
|
+
const [main] = locales;
|
|
12
|
+
if (main === void 0) throw new Error("[ginko-docs] `locales` is empty. Fix: pass the same list as `locales` in defineSite.");
|
|
13
|
+
const address = path;
|
|
14
|
+
return Object.fromEntries(locales.map((l) => [l, l === main ? path : address === "/" ? `/${l}` : `/${l}${path}`]));
|
|
15
|
+
}
|
|
16
|
+
function docsCollection(opts) {
|
|
17
|
+
const { locales } = opts;
|
|
18
|
+
const base = opts.base ?? "/docs";
|
|
19
|
+
return collection({
|
|
20
|
+
label: opts.label ?? "Docs",
|
|
21
|
+
...sourceOf(opts.source),
|
|
22
|
+
max: opts.max ?? 500,
|
|
23
|
+
order: "manual",
|
|
24
|
+
route: localized(locales, `${base}/[slug]`),
|
|
25
|
+
fields: {
|
|
26
|
+
title: f.text("Title"),
|
|
27
|
+
description: f.longtext("Description", { optional: true }),
|
|
28
|
+
/** Starts a group in the side navigation under this heading; the pages after it belong to it until the next one. */
|
|
29
|
+
section: f.text("Section", { optional: true }),
|
|
30
|
+
/** Nests the entry under another doc in the side navigation and the breadcrumbs. */
|
|
31
|
+
parent: f.ref("Parent page", { to: "docs", optional: true }),
|
|
32
|
+
/** Section tab above the side navigation; a page without one follows the tab of the page before it. Children follow their parent. */
|
|
33
|
+
tab: f.text("Tab", { optional: true, max: 30 }),
|
|
34
|
+
/** A short label next to the entry in the side navigation, e.g. "New". */
|
|
35
|
+
badge: f.text("Badge", { optional: true, max: 20 }),
|
|
36
|
+
/** An icon name such as `lucide:book-open` (any installed Iconify set), shown before the title in the side navigation. */
|
|
37
|
+
icon: f.text("Icon", { optional: true, max: 60, translate: false }),
|
|
38
|
+
slug: f.slug("Address", { from: "title" }),
|
|
39
|
+
body: f.markdown("Text", { profile: "page" })
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
function docsHome(opts = {}) {
|
|
44
|
+
return single({
|
|
45
|
+
label: "Start page",
|
|
46
|
+
...sourceOf(opts.source),
|
|
47
|
+
fields: {
|
|
48
|
+
title: f.text("Title", { max: 120 }),
|
|
49
|
+
description: f.longtext("Description", { optional: true, max: 400 }),
|
|
50
|
+
/** A command shown with a copy button, e.g. `pnpm add @lupinum/ginko`. */
|
|
51
|
+
install: f.text("Install command", { optional: true, max: 200, translate: false }),
|
|
52
|
+
/** Buttons under the description; the first one is the main one. */
|
|
53
|
+
links: f.list("Links", { itemLabel: "Link", fields: { label: f.text("Text", { max: 40 }), href: f.text("Target", { max: 300 }) }, max: 2, default: [] }),
|
|
54
|
+
features: f.list("Features", {
|
|
55
|
+
itemLabel: "Feature",
|
|
56
|
+
fields: {
|
|
57
|
+
icon: f.text("Icon", { optional: true, max: 60, translate: false }),
|
|
58
|
+
title: f.text("Title", { max: 80 }),
|
|
59
|
+
description: f.longtext("Description", { max: 300 }),
|
|
60
|
+
href: f.text("Link", { optional: true, max: 300 })
|
|
61
|
+
},
|
|
62
|
+
max: 12,
|
|
63
|
+
default: []
|
|
64
|
+
}),
|
|
65
|
+
body: f.markdown("Text", { profile: "page", optional: true })
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
function blogCollections(opts) {
|
|
70
|
+
const { locales } = opts;
|
|
71
|
+
return {
|
|
72
|
+
posts: labelsIn(posts({ ...sourceOf(opts.source), max: opts.max, route: localized(locales, `${BLOG_PATH}/[slug]`) }), "en"),
|
|
73
|
+
authors: labelsIn(authors(sourceOf(opts.source)), "en")
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
function changelogCollection(opts = {}) {
|
|
77
|
+
return labelsIn(changelog({ ...sourceOf(opts.source), max: opts.max }), "en");
|
|
78
|
+
}
|
|
79
|
+
const homePages = (opts) => localized(opts.locales, "/");
|
|
80
|
+
const blogPages = (opts) => localized(opts.locales, BLOG_PATH);
|
|
81
|
+
const changelogPages = (opts) => localized(opts.locales, CHANGELOG_PATH);
|
|
82
|
+
|
|
83
|
+
export { blogCollections, blogPages, changelogCollection, changelogPages, docsCollection, docsHome, homePages };
|
package/dist/icons.d.mts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { getIconData } from '@iconify/utils';
|
|
2
|
+
import { NuxtModule } from 'nuxt/schema';
|
|
3
|
+
|
|
4
|
+
type IconSet = Parameters<typeof getIconData>[0];
|
|
5
|
+
type Entry = [body: string, viewBox: string];
|
|
6
|
+
/**
|
|
7
|
+
* Code without its comments, so a commented-out icon is not bundled. `//` counts only at a line start or after a space
|
|
8
|
+
* (not in `https://`). In a .vue file the template keeps its text; only `<!-- -->` and the comments inside `<script>` go.
|
|
9
|
+
*/
|
|
10
|
+
declare const stripComments: (source: string, file?: string) => string;
|
|
11
|
+
/** The icon names in app.config.ts (`icon: 'x'`) or a .vue file (`<Icon name="x">`, `icon="x"`). Comments are ignored. */
|
|
12
|
+
declare const codeIconNames: (source: string, file: string) => string[];
|
|
13
|
+
/**
|
|
14
|
+
* The icon names a content file names. YAML, JSON and front matter are read whole. In Markdown only the front matter,
|
|
15
|
+
* the attributes of a component (`:card{icon="x"}`) and the `---` block inside a `::component` count; prose and code are skipped.
|
|
16
|
+
*/
|
|
17
|
+
declare const contentIconNames: (source: string, file: string) => string[];
|
|
18
|
+
/** One icon as [svg body, viewBox], read from the `docs` collection folder or an installed @iconify-json set (looked up from `roots`). */
|
|
19
|
+
declare const readIcon: (name: string, roots: readonly string[], customDir: string, sets?: Map<string, IconSet | undefined>) => Entry | undefined;
|
|
20
|
+
interface CollectOptions {
|
|
21
|
+
/** The layer's own folder (its `app/` is scanned for literal names, its `icons/` holds the `docs:` logos). */
|
|
22
|
+
layerRoot: string;
|
|
23
|
+
/** Root folders of every layer, the site first. Their `content/`, `app.config.ts` and (for the site's own layers) `app/` are scanned. */
|
|
24
|
+
roots: readonly string[];
|
|
25
|
+
/** Where to resolve `@iconify-json/<set>` from. */
|
|
26
|
+
resolveFrom: readonly string[];
|
|
27
|
+
/** Paths in warnings are shown relative to this folder. */
|
|
28
|
+
relativeTo: string;
|
|
29
|
+
}
|
|
30
|
+
/** Every icon the layer and the site name, read from the installed sets, plus one warning per name that is not installed. */
|
|
31
|
+
declare const collectIcons: (o: CollectOptions) => {
|
|
32
|
+
icons: Record<string, Entry>;
|
|
33
|
+
warnings: string[];
|
|
34
|
+
};
|
|
35
|
+
declare const docsIcons: NuxtModule;
|
|
36
|
+
|
|
37
|
+
export { codeIconNames, collectIcons, contentIconNames, docsIcons as default, readIcon, stripComments };
|
|
38
|
+
export type { CollectOptions };
|
package/dist/icons.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { getIconData } from '@iconify/utils';
|
|
2
|
+
import { NuxtModule } from 'nuxt/schema';
|
|
3
|
+
|
|
4
|
+
type IconSet = Parameters<typeof getIconData>[0];
|
|
5
|
+
type Entry = [body: string, viewBox: string];
|
|
6
|
+
/**
|
|
7
|
+
* Code without its comments, so a commented-out icon is not bundled. `//` counts only at a line start or after a space
|
|
8
|
+
* (not in `https://`). In a .vue file the template keeps its text; only `<!-- -->` and the comments inside `<script>` go.
|
|
9
|
+
*/
|
|
10
|
+
declare const stripComments: (source: string, file?: string) => string;
|
|
11
|
+
/** The icon names in app.config.ts (`icon: 'x'`) or a .vue file (`<Icon name="x">`, `icon="x"`). Comments are ignored. */
|
|
12
|
+
declare const codeIconNames: (source: string, file: string) => string[];
|
|
13
|
+
/**
|
|
14
|
+
* The icon names a content file names. YAML, JSON and front matter are read whole. In Markdown only the front matter,
|
|
15
|
+
* the attributes of a component (`:card{icon="x"}`) and the `---` block inside a `::component` count; prose and code are skipped.
|
|
16
|
+
*/
|
|
17
|
+
declare const contentIconNames: (source: string, file: string) => string[];
|
|
18
|
+
/** One icon as [svg body, viewBox], read from the `docs` collection folder or an installed @iconify-json set (looked up from `roots`). */
|
|
19
|
+
declare const readIcon: (name: string, roots: readonly string[], customDir: string, sets?: Map<string, IconSet | undefined>) => Entry | undefined;
|
|
20
|
+
interface CollectOptions {
|
|
21
|
+
/** The layer's own folder (its `app/` is scanned for literal names, its `icons/` holds the `docs:` logos). */
|
|
22
|
+
layerRoot: string;
|
|
23
|
+
/** Root folders of every layer, the site first. Their `content/`, `app.config.ts` and (for the site's own layers) `app/` are scanned. */
|
|
24
|
+
roots: readonly string[];
|
|
25
|
+
/** Where to resolve `@iconify-json/<set>` from. */
|
|
26
|
+
resolveFrom: readonly string[];
|
|
27
|
+
/** Paths in warnings are shown relative to this folder. */
|
|
28
|
+
relativeTo: string;
|
|
29
|
+
}
|
|
30
|
+
/** Every icon the layer and the site name, read from the installed sets, plus one warning per name that is not installed. */
|
|
31
|
+
declare const collectIcons: (o: CollectOptions) => {
|
|
32
|
+
icons: Record<string, Entry>;
|
|
33
|
+
warnings: string[];
|
|
34
|
+
};
|
|
35
|
+
declare const docsIcons: NuxtModule;
|
|
36
|
+
|
|
37
|
+
export { codeIconNames, collectIcons, contentIconNames, docsIcons as default, readIcon, stripComments };
|
|
38
|
+
export type { CollectOptions };
|