@astrojs/starlight 0.41.11 → 0.42.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/dist/_virtual/_rolldown/runtime.js +13 -0
- package/dist/components/MobileMenuToggle.astro +65 -0
- package/{components → dist/components}/PageFrame.astro +32 -8
- package/dist/components-internals/Icons.d.ts +415 -0
- package/dist/components-internals/Icons.js +140 -0
- package/dist/components-internals/SidebarPersistState.d.ts +1 -0
- package/dist/components-internals/SidebarPersistState.js +53 -0
- package/dist/components-internals/TableOfContents/starlight-toc.d.ts +18 -0
- package/dist/components-internals/TableOfContents/starlight-toc.js +88 -0
- package/dist/constants.d.ts +4 -0
- package/dist/constants.js +4 -0
- package/{expressive-code.d.ts → dist/expressive-code.d.ts} +6 -13
- package/dist/expressive-code.js +31 -0
- package/dist/global.d.ts +62 -0
- package/dist/global.js +2 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +109 -0
- package/dist/integrations/aside-utils.d.ts +9 -0
- package/dist/integrations/aside-utils.js +35 -0
- package/dist/integrations/expressive-code/hast.d.ts +1 -0
- package/dist/integrations/expressive-code/hast.js +2 -0
- package/dist/integrations/expressive-code/index.d.ts +60 -0
- package/dist/integrations/expressive-code/index.js +48 -0
- package/dist/integrations/expressive-code/preprocessor.d.ts +17 -0
- package/dist/integrations/expressive-code/preprocessor.js +76 -0
- package/dist/integrations/expressive-code/themes/night-owl-dark.js +4 -0
- package/dist/integrations/expressive-code/themes/night-owl-light.js +4 -0
- package/dist/integrations/expressive-code/theming.d.ts +16 -0
- package/dist/integrations/expressive-code/theming.js +71 -0
- package/dist/integrations/expressive-code/translations.d.ts +8 -0
- package/dist/integrations/expressive-code/translations.js +26 -0
- package/dist/integrations/markdown-icon.d.ts +8 -0
- package/dist/integrations/markdown-icon.js +14 -0
- package/dist/integrations/markdown-plugins.d.ts +18 -0
- package/dist/integrations/markdown-plugins.js +36 -0
- package/dist/integrations/markdown-processor.d.ts +29 -0
- package/dist/integrations/markdown-processor.js +44 -0
- package/dist/integrations/pagefind.d.ts +7 -0
- package/dist/integrations/pagefind.js +34 -0
- package/dist/integrations/rehype-code-rtl-support.d.ts +21 -0
- package/dist/integrations/rehype-code-rtl-support.js +36 -0
- package/dist/integrations/rehype-heading-links.d.ts +10 -0
- package/dist/integrations/rehype-heading-links.js +57 -0
- package/dist/integrations/remark-asides.d.ts +32 -0
- package/dist/integrations/remark-asides.js +166 -0
- package/dist/integrations/remark-rehype.d.ts +17 -0
- package/dist/integrations/remark-rehype.js +51 -0
- package/dist/integrations/satteri.d.ts +13 -0
- package/dist/integrations/satteri.js +209 -0
- package/dist/integrations/shared/absolutePathToLang.d.ts +10 -0
- package/dist/integrations/shared/absolutePathToLang.js +13 -0
- package/dist/integrations/shared/localeToLang.d.ts +10 -0
- package/dist/integrations/shared/localeToLang.js +13 -0
- package/dist/integrations/shared/slugToLocale.d.ts +12 -0
- package/dist/integrations/shared/slugToLocale.js +15 -0
- package/dist/integrations/sitemap.d.ts +12 -0
- package/dist/integrations/sitemap.js +19 -0
- package/dist/integrations/vite-layer-order.d.ts +15 -0
- package/dist/integrations/vite-layer-order.js +56 -0
- package/dist/integrations/vite-lazy-barrel-optimization.d.ts +12 -0
- package/dist/integrations/vite-lazy-barrel-optimization.js +33 -0
- package/dist/integrations/vite-virtual-modules.d.ts +14 -0
- package/dist/integrations/vite-virtual-modules.js +108 -0
- package/dist/internal.d.ts +3 -0
- package/dist/internal.js +3 -0
- package/dist/loaders.d.ts +20 -0
- package/dist/loaders.js +49 -0
- package/dist/locals.d.ts +15 -0
- package/dist/locals.js +33 -0
- package/dist/package.js +4 -0
- package/{props.ts → dist/props.d.ts} +6 -4
- package/dist/props.js +1 -0
- package/dist/route-data.d.ts +7 -0
- package/dist/route-data.js +6 -0
- package/dist/schema.d.ts +426 -0
- package/dist/schema.js +103 -0
- package/dist/schemas/badge.d.ts +86 -0
- package/dist/schemas/badge.js +39 -0
- package/dist/schemas/components.d.ts +236 -0
- package/dist/schemas/components.js +36 -0
- package/dist/schemas/expressiveCode.d.ts +7 -0
- package/dist/schemas/expressiveCode.js +5 -0
- package/dist/schemas/favicon.d.ts +9 -0
- package/dist/schemas/favicon.js +32 -0
- package/dist/schemas/head.d.ts +33 -0
- package/dist/schemas/head.js +41 -0
- package/dist/schemas/hero.d.ts +319 -0
- package/dist/schemas/hero.js +73 -0
- package/dist/schemas/i18n.d.ts +125 -0
- package/dist/schemas/i18n.js +76 -0
- package/dist/schemas/icon.d.ts +284 -0
- package/dist/schemas/icon.js +7 -0
- package/dist/schemas/locale.d.ts +20 -0
- package/dist/schemas/locale.js +11 -0
- package/dist/schemas/logo.d.ts +32 -0
- package/dist/schemas/logo.js +14 -0
- package/dist/schemas/pagefind.d.ts +166 -0
- package/dist/schemas/pagefind.js +31 -0
- package/dist/schemas/prevNextLink.d.ts +10 -0
- package/dist/schemas/prevNextLink.js +14 -0
- package/dist/schemas/sidebar.d.ts +205 -0
- package/dist/schemas/sidebar.js +71 -0
- package/dist/schemas/site-title.d.ts +7 -0
- package/dist/schemas/site-title.js +17 -0
- package/dist/schemas/social.d.ts +292 -0
- package/dist/schemas/social.js +18 -0
- package/dist/schemas/tableOfContents.d.ts +24 -0
- package/dist/schemas/tableOfContents.js +16 -0
- package/dist/translations/ar.js +36 -0
- package/dist/translations/ca.js +46 -0
- package/dist/translations/cs.js +46 -0
- package/dist/translations/da.js +33 -0
- package/dist/translations/de.js +33 -0
- package/dist/translations/el.js +33 -0
- package/dist/translations/en.js +33 -0
- package/dist/translations/es.js +46 -0
- package/dist/translations/fa.js +33 -0
- package/dist/translations/fi.js +33 -0
- package/dist/translations/fr.js +36 -0
- package/dist/translations/gl.js +46 -0
- package/dist/translations/he.js +33 -0
- package/dist/translations/hi.js +36 -0
- package/dist/translations/hu.js +46 -0
- package/dist/translations/id.js +33 -0
- package/dist/translations/index.d.ts +48 -0
- package/dist/translations/index.js +75 -0
- package/dist/translations/it.js +36 -0
- package/dist/translations/ja.js +36 -0
- package/dist/translations/ko.js +36 -0
- package/dist/translations/lv.js +33 -0
- package/dist/translations/nb.js +33 -0
- package/dist/translations/nl.js +33 -0
- package/dist/translations/pl.js +36 -0
- package/dist/translations/pt.js +36 -0
- package/dist/translations/ro.js +33 -0
- package/dist/translations/ru.js +36 -0
- package/dist/translations/sk.js +33 -0
- package/dist/translations/sv.js +33 -0
- package/dist/translations/th.js +33 -0
- package/dist/translations/tr.js +33 -0
- package/dist/translations/uk.js +33 -0
- package/dist/translations/vi.js +33 -0
- package/dist/translations/zh-CN.js +36 -0
- package/dist/translations/zh-TW.js +36 -0
- package/dist/types.d.ts +4 -0
- package/dist/types.js +1 -0
- package/{user-components → dist/user-components}/FileTree.astro +1 -1
- package/{user-components → dist/user-components}/Steps.astro +1 -1
- package/{user-components → dist/user-components}/TabItem.astro +1 -1
- package/{user-components → dist/user-components}/Tabs.astro +1 -1
- package/dist/user-components/file-tree-icons.d.ts +178 -0
- package/dist/user-components/file-tree-icons.js +632 -0
- package/dist/user-components/file-tree-processor.d.ts +16 -0
- package/dist/user-components/file-tree-processor.js +132 -0
- package/dist/user-components/steps-processor.d.ts +10 -0
- package/dist/user-components/steps-processor.js +39 -0
- package/dist/user-components/tabs-processor.d.ts +23 -0
- package/dist/user-components/tabs-processor.js +70 -0
- package/dist/utils/base.d.ts +7 -0
- package/dist/utils/base.js +15 -0
- package/dist/utils/canonical.d.ts +10 -0
- package/dist/utils/canonical.js +14 -0
- package/dist/utils/collection-fs.d.ts +13 -0
- package/dist/utils/collection-fs.js +19 -0
- package/{utils/collection.ts → dist/utils/collection.d.ts} +9 -20
- package/dist/utils/collection.js +26 -0
- package/dist/utils/createPathFormatter.d.ts +9 -0
- package/dist/utils/createPathFormatter.js +35 -0
- package/dist/utils/createTranslationSystem.d.ts +23 -0
- package/dist/utils/createTranslationSystem.js +84 -0
- package/dist/utils/error-map.d.ts +23 -0
- package/dist/utils/error-map.js +125 -0
- package/dist/utils/format-path.d.ts +4 -0
- package/dist/utils/format-path.js +9 -0
- package/dist/utils/generateToC.d.ts +14 -0
- package/dist/utils/generateToC.js +25 -0
- package/dist/utils/git.d.ts +12 -0
- package/dist/utils/git.js +71 -0
- package/dist/utils/gitInlined.d.ts +6 -0
- package/dist/utils/gitInlined.js +11 -0
- package/dist/utils/head.d.ts +7 -0
- package/dist/utils/head.js +233 -0
- package/dist/utils/i18n.d.ts +50 -0
- package/dist/utils/i18n.js +141 -0
- package/dist/utils/localizedUrl.d.ts +8 -0
- package/dist/utils/localizedUrl.js +28 -0
- package/dist/utils/navigation.d.ts +19 -0
- package/dist/utils/navigation.js +353 -0
- package/dist/utils/path.d.ts +21 -0
- package/dist/utils/path.js +51 -0
- package/dist/utils/plugins.d.ts +721 -0
- package/dist/utils/plugins.js +174 -0
- package/dist/utils/routing/data.d.ts +20 -0
- package/dist/utils/routing/data.js +127 -0
- package/dist/utils/routing/index.d.ts +21 -0
- package/dist/utils/routing/index.js +106 -0
- package/dist/utils/routing/middleware.d.ts +11 -0
- package/dist/utils/routing/middleware.js +65 -0
- package/dist/utils/routing/types.d.ts +93 -0
- package/dist/utils/routing/types.js +1 -0
- package/dist/utils/slugs.d.ts +45 -0
- package/dist/utils/slugs.js +104 -0
- package/dist/utils/starlight-page.d.ts +36 -0
- package/dist/utils/starlight-page.js +120 -0
- package/dist/utils/translations-fs.d.ts +15 -0
- package/dist/utils/translations-fs.js +39 -0
- package/dist/utils/translations.d.ts +20 -0
- package/dist/utils/translations.js +29 -0
- package/dist/utils/types.d.ts +5 -0
- package/dist/utils/types.js +1 -0
- package/dist/utils/url.d.ts +7 -0
- package/{utils/url.ts → dist/utils/url.js} +5 -4
- package/dist/utils/user-config.d.ts +2055 -0
- package/dist/utils/user-config.js +136 -0
- package/dist/utils/validateLogoImports.d.ts +5 -0
- package/dist/utils/validateLogoImports.js +16 -0
- package/dist/utils/zodDeepMerge.d.ts +16 -0
- package/dist/utils/zodDeepMerge.js +53 -0
- package/package.json +60 -34
- package/CHANGELOG.md +0 -3051
- package/components/MobileMenuToggle.astro +0 -114
- package/components-internals/Icons.ts +0 -248
- package/components-internals/SidebarPersistState.ts +0 -71
- package/components-internals/TableOfContents/starlight-toc.ts +0 -127
- package/constants.ts +0 -4
- package/expressive-code.mjs +0 -23
- package/global.d.ts +0 -11
- package/i18n.d.ts +0 -18
- package/index.ts +0 -200
- package/integrations/aside-utils.ts +0 -41
- package/integrations/expressive-code/hast.d.ts +0 -5
- package/integrations/expressive-code/hast.mjs +0 -9
- package/integrations/expressive-code/index.ts +0 -125
- package/integrations/expressive-code/preprocessor.ts +0 -126
- package/integrations/expressive-code/themes/night-owl-dark.jsonc +0 -1796
- package/integrations/expressive-code/themes/night-owl-light.jsonc +0 -1695
- package/integrations/expressive-code/theming.ts +0 -105
- package/integrations/expressive-code/translations.ts +0 -36
- package/integrations/markdown-icon.ts +0 -13
- package/integrations/markdown-plugins.ts +0 -71
- package/integrations/markdown-processor.ts +0 -64
- package/integrations/pagefind.ts +0 -60
- package/integrations/rehype-code-rtl-support.ts +0 -37
- package/integrations/rehype-heading-links.ts +0 -79
- package/integrations/remark-asides.ts +0 -219
- package/integrations/remark-rehype.ts +0 -87
- package/integrations/satteri.ts +0 -265
- package/integrations/shared/absolutePathToLang.ts +0 -26
- package/integrations/shared/localeToLang.ts +0 -15
- package/integrations/shared/slugToLocale.ts +0 -18
- package/integrations/sitemap.ts +0 -23
- package/integrations/vite-layer-order.ts +0 -69
- package/integrations/vite-lazy-barrel-optimization.ts +0 -40
- package/integrations/vite-virtual-modules.ts +0 -175
- package/internal.ts +0 -6
- package/loaders.ts +0 -63
- package/locals.d.ts +0 -43
- package/locals.ts +0 -43
- package/route-data.ts +0 -11
- package/schema.ts +0 -167
- package/schemas/badge.ts +0 -40
- package/schemas/components.ts +0 -265
- package/schemas/expressiveCode.ts +0 -12
- package/schemas/favicon.ts +0 -40
- package/schemas/head.ts +0 -50
- package/schemas/hero.ts +0 -69
- package/schemas/i18n.ts +0 -244
- package/schemas/icon.ts +0 -7
- package/schemas/logo.ts +0 -28
- package/schemas/pagefind.ts +0 -128
- package/schemas/prevNextLink.ts +0 -18
- package/schemas/sidebar.ts +0 -163
- package/schemas/site-title.ts +0 -20
- package/schemas/social.ts +0 -23
- package/schemas/tableOfContents.ts +0 -21
- package/translations/README.md +0 -14
- package/translations/ar.json +0 -33
- package/translations/ca.json +0 -43
- package/translations/cs.json +0 -43
- package/translations/da.json +0 -30
- package/translations/de.json +0 -30
- package/translations/el.json +0 -30
- package/translations/en.json +0 -30
- package/translations/es.json +0 -43
- package/translations/fa.json +0 -30
- package/translations/fi.json +0 -30
- package/translations/fr.json +0 -33
- package/translations/gl.json +0 -43
- package/translations/he.json +0 -30
- package/translations/hi.json +0 -33
- package/translations/hu.json +0 -43
- package/translations/id.json +0 -30
- package/translations/index.ts +0 -76
- package/translations/it.json +0 -33
- package/translations/ja.json +0 -33
- package/translations/ko.json +0 -33
- package/translations/lv.json +0 -30
- package/translations/nb.json +0 -30
- package/translations/nl.json +0 -30
- package/translations/pl.json +0 -33
- package/translations/pt.json +0 -33
- package/translations/ro.json +0 -30
- package/translations/ru.json +0 -33
- package/translations/sk.json +0 -30
- package/translations/sv.json +0 -30
- package/translations/th.json +0 -30
- package/translations/tr.json +0 -30
- package/translations/uk.json +0 -30
- package/translations/vi.json +0 -30
- package/translations/zh-CN.json +0 -33
- package/translations/zh-TW.json +0 -33
- package/types.ts +0 -7
- package/user-components/file-tree-icons.ts +0 -782
- package/user-components/rehype-file-tree.ts +0 -251
- package/user-components/rehype-steps.ts +0 -85
- package/user-components/rehype-tabs.ts +0 -121
- package/utils/base.ts +0 -15
- package/utils/canonical.ts +0 -19
- package/utils/collection-fs.ts +0 -20
- package/utils/createPathFormatter.ts +0 -60
- package/utils/createTranslationSystem.ts +0 -137
- package/utils/error-map.ts +0 -222
- package/utils/format-path.ts +0 -7
- package/utils/generateToC.ts +0 -33
- package/utils/git.ts +0 -121
- package/utils/gitInlined.ts +0 -20
- package/utils/head.ts +0 -235
- package/utils/i18n.ts +0 -221
- package/utils/localizedUrl.ts +0 -51
- package/utils/navigation.ts +0 -574
- package/utils/path.ts +0 -58
- package/utils/plugins.ts +0 -498
- package/utils/routing/data.ts +0 -154
- package/utils/routing/index.ts +0 -139
- package/utils/routing/middleware.ts +0 -81
- package/utils/routing/types.ts +0 -101
- package/utils/slugs.ts +0 -119
- package/utils/starlight-page.ts +0 -205
- package/utils/translations-fs.ts +0 -54
- package/utils/translations.ts +0 -57
- package/utils/types.ts +0 -15
- package/utils/user-config.ts +0 -348
- package/utils/validateLogoImports.ts +0 -21
- package/utils/zodDeepMerge.ts +0 -144
- package/virtual-internal.d.ts +0 -149
- package/virtual.d.ts +0 -27
- /package/{components → dist/components}/AnchorHeading.astro +0 -0
- /package/{components → dist/components}/Banner.astro +0 -0
- /package/{components → dist/components}/ContentNotice.astro +0 -0
- /package/{components → dist/components}/ContentPanel.astro +0 -0
- /package/{components → dist/components}/DraftContentNotice.astro +0 -0
- /package/{components → dist/components}/EditLink.astro +0 -0
- /package/{components → dist/components}/FallbackContentNotice.astro +0 -0
- /package/{components → dist/components}/Footer.astro +0 -0
- /package/{components → dist/components}/Head.astro +0 -0
- /package/{components → dist/components}/Header.astro +0 -0
- /package/{components → dist/components}/Hero.astro +0 -0
- /package/{components → dist/components}/LanguageSelect.astro +0 -0
- /package/{components → dist/components}/LastUpdated.astro +0 -0
- /package/{components → dist/components}/MarkdownContent.astro +0 -0
- /package/{components → dist/components}/MobileMenuFooter.astro +0 -0
- /package/{components → dist/components}/MobileTableOfContents.astro +0 -0
- /package/{components → dist/components}/Page.astro +0 -0
- /package/{components → dist/components}/PageSidebar.astro +0 -0
- /package/{components → dist/components}/PageTitle.astro +0 -0
- /package/{components → dist/components}/Pagination.astro +0 -0
- /package/{components → dist/components}/Search.astro +0 -0
- /package/{components → dist/components}/Select.astro +0 -0
- /package/{components → dist/components}/Sidebar.astro +0 -0
- /package/{components → dist/components}/SidebarPersister.astro +0 -0
- /package/{components → dist/components}/SidebarRestorePoint.astro +0 -0
- /package/{components → dist/components}/SidebarSublist.astro +0 -0
- /package/{components → dist/components}/SiteTitle.astro +0 -0
- /package/{components → dist/components}/SkipLink.astro +0 -0
- /package/{components → dist/components}/SocialIcons.astro +0 -0
- /package/{components → dist/components}/StarlightPage.astro +0 -0
- /package/{components → dist/components}/TableOfContents.astro +0 -0
- /package/{components → dist/components}/ThemeProvider.astro +0 -0
- /package/{components → dist/components}/ThemeSelect.astro +0 -0
- /package/{components → dist/components}/TwoColumnContent.astro +0 -0
- /package/{components-internals → dist/components-internals}/TableOfContents/TableOfContentsList.astro +0 -0
- /package/{components.ts → dist/components.ts} +0 -0
- /package/{routes → dist/routes}/common.astro +0 -0
- /package/{routes → dist/routes}/ssr/404.astro +0 -0
- /package/{routes → dist/routes}/ssr/index.astro +0 -0
- /package/{routes → dist/routes}/static/404.astro +0 -0
- /package/{routes → dist/routes}/static/index.astro +0 -0
- /package/{style → dist/style}/anchor-links.css +0 -0
- /package/{style → dist/style}/asides.css +0 -0
- /package/{style → dist/style}/layers.css +0 -0
- /package/{style → dist/style}/markdown.css +0 -0
- /package/{style → dist/style}/print.css +0 -0
- /package/{style → dist/style}/props.css +0 -0
- /package/{style → dist/style}/reset.css +0 -0
- /package/{style → dist/style}/util.css +0 -0
- /package/{user-components → dist/user-components}/Aside.astro +0 -0
- /package/{user-components → dist/user-components}/Badge.astro +0 -0
- /package/{user-components → dist/user-components}/Card.astro +0 -0
- /package/{user-components → dist/user-components}/CardGrid.astro +0 -0
- /package/{user-components → dist/user-components}/Icon.astro +0 -0
- /package/{user-components → dist/user-components}/LinkButton.astro +0 -0
- /package/{user-components → dist/user-components}/LinkCard.astro +0 -0
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
import { z } from "astro/zod";
|
|
2
|
+
import { SchemaContext } from "astro:content";
|
|
3
|
+
//#region src/schemas/hero.d.ts
|
|
4
|
+
declare const HeroSchema: ({ image }: SchemaContext) => z.ZodObject<{
|
|
5
|
+
title: z.ZodOptional<z.ZodString>;
|
|
6
|
+
tagline: z.ZodOptional<z.ZodString>;
|
|
7
|
+
image: z.ZodOptional<z.ZodUnion<readonly [z.ZodObject<{
|
|
8
|
+
alt: z.ZodDefault<z.ZodString>;
|
|
9
|
+
file: any;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
+
alt: z.ZodDefault<z.ZodString>;
|
|
12
|
+
dark: any;
|
|
13
|
+
light: any;
|
|
14
|
+
}, z.core.$strip>, z.ZodPipe<z.ZodObject<{
|
|
15
|
+
html: z.ZodString;
|
|
16
|
+
}, z.core.$strip>, z.ZodTransform<{
|
|
17
|
+
html: string;
|
|
18
|
+
alt: string;
|
|
19
|
+
}, {
|
|
20
|
+
html: string;
|
|
21
|
+
}>>]>>;
|
|
22
|
+
actions: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
23
|
+
text: z.ZodString;
|
|
24
|
+
link: z.ZodString;
|
|
25
|
+
variant: z.ZodDefault<z.ZodEnum<{
|
|
26
|
+
primary: "primary";
|
|
27
|
+
secondary: "secondary";
|
|
28
|
+
minimal: "minimal";
|
|
29
|
+
}>>;
|
|
30
|
+
icon: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
|
|
31
|
+
server: "server";
|
|
32
|
+
external: "external";
|
|
33
|
+
error: "error";
|
|
34
|
+
link: "link";
|
|
35
|
+
"up-caret": "up-caret";
|
|
36
|
+
"down-caret": "down-caret";
|
|
37
|
+
"right-caret": "right-caret";
|
|
38
|
+
"left-caret": "left-caret";
|
|
39
|
+
"up-arrow": "up-arrow";
|
|
40
|
+
"down-arrow": "down-arrow";
|
|
41
|
+
"right-arrow": "right-arrow";
|
|
42
|
+
"left-arrow": "left-arrow";
|
|
43
|
+
bars: "bars";
|
|
44
|
+
translate: "translate";
|
|
45
|
+
pencil: "pencil";
|
|
46
|
+
pen: "pen";
|
|
47
|
+
document: "document";
|
|
48
|
+
"add-document": "add-document";
|
|
49
|
+
setting: "setting";
|
|
50
|
+
"link-alt": "link-alt";
|
|
51
|
+
download: "download";
|
|
52
|
+
"cloud-download": "cloud-download";
|
|
53
|
+
moon: "moon";
|
|
54
|
+
sun: "sun";
|
|
55
|
+
clock: "clock";
|
|
56
|
+
laptop: "laptop";
|
|
57
|
+
desktop: "desktop";
|
|
58
|
+
"mobile-android": "mobile-android";
|
|
59
|
+
window: "window";
|
|
60
|
+
database: "database";
|
|
61
|
+
"code-branch": "code-branch";
|
|
62
|
+
"open-book": "open-book";
|
|
63
|
+
notes: "notes";
|
|
64
|
+
information: "information";
|
|
65
|
+
magnifier: "magnifier";
|
|
66
|
+
"forward-slash": "forward-slash";
|
|
67
|
+
close: "close";
|
|
68
|
+
warning: "warning";
|
|
69
|
+
"approve-check-circle": "approve-check-circle";
|
|
70
|
+
"approve-check": "approve-check";
|
|
71
|
+
"question-circle": "question-circle";
|
|
72
|
+
question: "question";
|
|
73
|
+
rocket: "rocket";
|
|
74
|
+
star: "star";
|
|
75
|
+
puzzle: "puzzle";
|
|
76
|
+
"list-format": "list-format";
|
|
77
|
+
analytics: "analytics";
|
|
78
|
+
random: "random";
|
|
79
|
+
padlock: "padlock";
|
|
80
|
+
comment: "comment";
|
|
81
|
+
"comment-alt": "comment-alt";
|
|
82
|
+
heart: "heart";
|
|
83
|
+
github: "github";
|
|
84
|
+
gitlab: "gitlab";
|
|
85
|
+
bitbucket: "bitbucket";
|
|
86
|
+
forgejo: "forgejo";
|
|
87
|
+
codePen: "codePen";
|
|
88
|
+
farcaster: "farcaster";
|
|
89
|
+
discord: "discord";
|
|
90
|
+
gitter: "gitter";
|
|
91
|
+
twitter: "twitter";
|
|
92
|
+
"x.com": "x.com";
|
|
93
|
+
mastodon: "mastodon";
|
|
94
|
+
codeberg: "codeberg";
|
|
95
|
+
youtube: "youtube";
|
|
96
|
+
threads: "threads";
|
|
97
|
+
linkedin: "linkedin";
|
|
98
|
+
twitch: "twitch";
|
|
99
|
+
azureDevOps: "azureDevOps";
|
|
100
|
+
microsoftTeams: "microsoftTeams";
|
|
101
|
+
instagram: "instagram";
|
|
102
|
+
stackOverflow: "stackOverflow";
|
|
103
|
+
telegram: "telegram";
|
|
104
|
+
whatsApp: "whatsApp";
|
|
105
|
+
rss: "rss";
|
|
106
|
+
facebook: "facebook";
|
|
107
|
+
email: "email";
|
|
108
|
+
phone: "phone";
|
|
109
|
+
reddit: "reddit";
|
|
110
|
+
patreon: "patreon";
|
|
111
|
+
signal: "signal";
|
|
112
|
+
slack: "slack";
|
|
113
|
+
matrix: "matrix";
|
|
114
|
+
hackerOne: "hackerOne";
|
|
115
|
+
openCollective: "openCollective";
|
|
116
|
+
blueSky: "blueSky";
|
|
117
|
+
discourse: "discourse";
|
|
118
|
+
zulip: "zulip";
|
|
119
|
+
pinterest: "pinterest";
|
|
120
|
+
tiktok: "tiktok";
|
|
121
|
+
goodreads: "goodreads";
|
|
122
|
+
hypothesis: "hypothesis";
|
|
123
|
+
astro: "astro";
|
|
124
|
+
solidjs: "solidjs";
|
|
125
|
+
alpine: "alpine";
|
|
126
|
+
pnpm: "pnpm";
|
|
127
|
+
biome: "biome";
|
|
128
|
+
bun: "bun";
|
|
129
|
+
mdx: "mdx";
|
|
130
|
+
apple: "apple";
|
|
131
|
+
linux: "linux";
|
|
132
|
+
homebrew: "homebrew";
|
|
133
|
+
nix: "nix";
|
|
134
|
+
starlight: "starlight";
|
|
135
|
+
pkl: "pkl";
|
|
136
|
+
node: "node";
|
|
137
|
+
cloudflare: "cloudflare";
|
|
138
|
+
vercel: "vercel";
|
|
139
|
+
netlify: "netlify";
|
|
140
|
+
deno: "deno";
|
|
141
|
+
jsr: "jsr";
|
|
142
|
+
nostr: "nostr";
|
|
143
|
+
backstage: "backstage";
|
|
144
|
+
confluence: "confluence";
|
|
145
|
+
jira: "jira";
|
|
146
|
+
storybook: "storybook";
|
|
147
|
+
vscode: "vscode";
|
|
148
|
+
jetbrains: "jetbrains";
|
|
149
|
+
zed: "zed";
|
|
150
|
+
vim: "vim";
|
|
151
|
+
figma: "figma";
|
|
152
|
+
sketch: "sketch";
|
|
153
|
+
npm: "npm";
|
|
154
|
+
npmx: "npmx";
|
|
155
|
+
sourcehut: "sourcehut";
|
|
156
|
+
substack: "substack";
|
|
157
|
+
chrome: "chrome";
|
|
158
|
+
edge: "edge";
|
|
159
|
+
firefox: "firefox";
|
|
160
|
+
safari: "safari";
|
|
161
|
+
"seti:folder": "seti:folder";
|
|
162
|
+
"seti:bsl": "seti:bsl";
|
|
163
|
+
"seti:mdo": "seti:mdo";
|
|
164
|
+
"seti:salesforce": "seti:salesforce";
|
|
165
|
+
"seti:asm": "seti:asm";
|
|
166
|
+
"seti:bicep": "seti:bicep";
|
|
167
|
+
"seti:bazel": "seti:bazel";
|
|
168
|
+
"seti:c": "seti:c";
|
|
169
|
+
"seti:c-sharp": "seti:c-sharp";
|
|
170
|
+
"seti:html": "seti:html";
|
|
171
|
+
"seti:cpp": "seti:cpp";
|
|
172
|
+
"seti:clojure": "seti:clojure";
|
|
173
|
+
"seti:coldfusion": "seti:coldfusion";
|
|
174
|
+
"seti:config": "seti:config";
|
|
175
|
+
"seti:crystal": "seti:crystal";
|
|
176
|
+
"seti:crystal_embedded": "seti:crystal_embedded";
|
|
177
|
+
"seti:json": "seti:json";
|
|
178
|
+
"seti:css": "seti:css";
|
|
179
|
+
"seti:csv": "seti:csv";
|
|
180
|
+
"seti:xls": "seti:xls";
|
|
181
|
+
"seti:cu": "seti:cu";
|
|
182
|
+
"seti:cake": "seti:cake";
|
|
183
|
+
"seti:cake_php": "seti:cake_php";
|
|
184
|
+
"seti:d": "seti:d";
|
|
185
|
+
"seti:word": "seti:word";
|
|
186
|
+
"seti:elixir": "seti:elixir";
|
|
187
|
+
"seti:elixir_script": "seti:elixir_script";
|
|
188
|
+
"seti:hex": "seti:hex";
|
|
189
|
+
"seti:elm": "seti:elm";
|
|
190
|
+
"seti:favicon": "seti:favicon";
|
|
191
|
+
"seti:f-sharp": "seti:f-sharp";
|
|
192
|
+
"seti:git": "seti:git";
|
|
193
|
+
"seti:go": "seti:go";
|
|
194
|
+
"seti:godot": "seti:godot";
|
|
195
|
+
"seti:gradle": "seti:gradle";
|
|
196
|
+
"seti:grails": "seti:grails";
|
|
197
|
+
"seti:graphql": "seti:graphql";
|
|
198
|
+
"seti:hacklang": "seti:hacklang";
|
|
199
|
+
"seti:haml": "seti:haml";
|
|
200
|
+
"seti:mustache": "seti:mustache";
|
|
201
|
+
"seti:haskell": "seti:haskell";
|
|
202
|
+
"seti:haxe": "seti:haxe";
|
|
203
|
+
"seti:jade": "seti:jade";
|
|
204
|
+
"seti:java": "seti:java";
|
|
205
|
+
"seti:javascript": "seti:javascript";
|
|
206
|
+
"seti:jinja": "seti:jinja";
|
|
207
|
+
"seti:julia": "seti:julia";
|
|
208
|
+
"seti:karma": "seti:karma";
|
|
209
|
+
"seti:kotlin": "seti:kotlin";
|
|
210
|
+
"seti:dart": "seti:dart";
|
|
211
|
+
"seti:liquid": "seti:liquid";
|
|
212
|
+
"seti:livescript": "seti:livescript";
|
|
213
|
+
"seti:lua": "seti:lua";
|
|
214
|
+
"seti:markdown": "seti:markdown";
|
|
215
|
+
"seti:argdown": "seti:argdown";
|
|
216
|
+
"seti:info": "seti:info";
|
|
217
|
+
"seti:clock": "seti:clock";
|
|
218
|
+
"seti:maven": "seti:maven";
|
|
219
|
+
"seti:nim": "seti:nim";
|
|
220
|
+
"seti:github": "seti:github";
|
|
221
|
+
"seti:notebook": "seti:notebook";
|
|
222
|
+
"seti:nunjucks": "seti:nunjucks";
|
|
223
|
+
"seti:npm": "seti:npm";
|
|
224
|
+
"seti:ocaml": "seti:ocaml";
|
|
225
|
+
"seti:odata": "seti:odata";
|
|
226
|
+
"seti:perl": "seti:perl";
|
|
227
|
+
"seti:php": "seti:php";
|
|
228
|
+
"seti:pipeline": "seti:pipeline";
|
|
229
|
+
"seti:pddl": "seti:pddl";
|
|
230
|
+
"seti:plan": "seti:plan";
|
|
231
|
+
"seti:happenings": "seti:happenings";
|
|
232
|
+
"seti:powershell": "seti:powershell";
|
|
233
|
+
"seti:prisma": "seti:prisma";
|
|
234
|
+
"seti:pug": "seti:pug";
|
|
235
|
+
"seti:puppet": "seti:puppet";
|
|
236
|
+
"seti:purescript": "seti:purescript";
|
|
237
|
+
"seti:python": "seti:python";
|
|
238
|
+
"seti:react": "seti:react";
|
|
239
|
+
"seti:rescript": "seti:rescript";
|
|
240
|
+
"seti:R": "seti:R";
|
|
241
|
+
"seti:ruby": "seti:ruby";
|
|
242
|
+
"seti:rust": "seti:rust";
|
|
243
|
+
"seti:sass": "seti:sass";
|
|
244
|
+
"seti:spring": "seti:spring";
|
|
245
|
+
"seti:slim": "seti:slim";
|
|
246
|
+
"seti:smarty": "seti:smarty";
|
|
247
|
+
"seti:sbt": "seti:sbt";
|
|
248
|
+
"seti:scala": "seti:scala";
|
|
249
|
+
"seti:ethereum": "seti:ethereum";
|
|
250
|
+
"seti:stylus": "seti:stylus";
|
|
251
|
+
"seti:svelte": "seti:svelte";
|
|
252
|
+
"seti:swift": "seti:swift";
|
|
253
|
+
"seti:db": "seti:db";
|
|
254
|
+
"seti:terraform": "seti:terraform";
|
|
255
|
+
"seti:tex": "seti:tex";
|
|
256
|
+
"seti:default": "seti:default";
|
|
257
|
+
"seti:twig": "seti:twig";
|
|
258
|
+
"seti:typescript": "seti:typescript";
|
|
259
|
+
"seti:tsconfig": "seti:tsconfig";
|
|
260
|
+
"seti:vala": "seti:vala";
|
|
261
|
+
"seti:vite": "seti:vite";
|
|
262
|
+
"seti:vue": "seti:vue";
|
|
263
|
+
"seti:wasm": "seti:wasm";
|
|
264
|
+
"seti:wat": "seti:wat";
|
|
265
|
+
"seti:xml": "seti:xml";
|
|
266
|
+
"seti:yml": "seti:yml";
|
|
267
|
+
"seti:prolog": "seti:prolog";
|
|
268
|
+
"seti:zig": "seti:zig";
|
|
269
|
+
"seti:zip": "seti:zip";
|
|
270
|
+
"seti:wgt": "seti:wgt";
|
|
271
|
+
"seti:illustrator": "seti:illustrator";
|
|
272
|
+
"seti:photoshop": "seti:photoshop";
|
|
273
|
+
"seti:pdf": "seti:pdf";
|
|
274
|
+
"seti:font": "seti:font";
|
|
275
|
+
"seti:image": "seti:image";
|
|
276
|
+
"seti:svg": "seti:svg";
|
|
277
|
+
"seti:sublime": "seti:sublime";
|
|
278
|
+
"seti:code-search": "seti:code-search";
|
|
279
|
+
"seti:shell": "seti:shell";
|
|
280
|
+
"seti:video": "seti:video";
|
|
281
|
+
"seti:audio": "seti:audio";
|
|
282
|
+
"seti:windows": "seti:windows";
|
|
283
|
+
"seti:jenkins": "seti:jenkins";
|
|
284
|
+
"seti:babel": "seti:babel";
|
|
285
|
+
"seti:bower": "seti:bower";
|
|
286
|
+
"seti:docker": "seti:docker";
|
|
287
|
+
"seti:code-climate": "seti:code-climate";
|
|
288
|
+
"seti:eslint": "seti:eslint";
|
|
289
|
+
"seti:firebase": "seti:firebase";
|
|
290
|
+
"seti:firefox": "seti:firefox";
|
|
291
|
+
"seti:gitlab": "seti:gitlab";
|
|
292
|
+
"seti:grunt": "seti:grunt";
|
|
293
|
+
"seti:gulp": "seti:gulp";
|
|
294
|
+
"seti:ionic": "seti:ionic";
|
|
295
|
+
"seti:platformio": "seti:platformio";
|
|
296
|
+
"seti:rollup": "seti:rollup";
|
|
297
|
+
"seti:stylelint": "seti:stylelint";
|
|
298
|
+
"seti:yarn": "seti:yarn";
|
|
299
|
+
"seti:webpack": "seti:webpack";
|
|
300
|
+
"seti:lock": "seti:lock";
|
|
301
|
+
"seti:license": "seti:license";
|
|
302
|
+
"seti:makefile": "seti:makefile";
|
|
303
|
+
"seti:heroku": "seti:heroku";
|
|
304
|
+
"seti:todo": "seti:todo";
|
|
305
|
+
"seti:ignored": "seti:ignored";
|
|
306
|
+
}>, z.ZodString]>, z.ZodTransform<{
|
|
307
|
+
readonly type: "icon";
|
|
308
|
+
readonly name: "server" | "external" | "error" | "link" | "up-caret" | "down-caret" | "right-caret" | "left-caret" | "up-arrow" | "down-arrow" | "right-arrow" | "left-arrow" | "bars" | "translate" | "pencil" | "pen" | "document" | "add-document" | "setting" | "link-alt" | "download" | "cloud-download" | "moon" | "sun" | "clock" | "laptop" | "desktop" | "mobile-android" | "window" | "database" | "code-branch" | "open-book" | "notes" | "information" | "magnifier" | "forward-slash" | "close" | "warning" | "approve-check-circle" | "approve-check" | "question-circle" | "question" | "rocket" | "star" | "puzzle" | "list-format" | "analytics" | "random" | "padlock" | "comment" | "comment-alt" | "heart" | "github" | "gitlab" | "bitbucket" | "forgejo" | "codePen" | "farcaster" | "discord" | "gitter" | "twitter" | "x.com" | "mastodon" | "codeberg" | "youtube" | "threads" | "linkedin" | "twitch" | "azureDevOps" | "microsoftTeams" | "instagram" | "stackOverflow" | "telegram" | "whatsApp" | "rss" | "facebook" | "email" | "phone" | "reddit" | "patreon" | "signal" | "slack" | "matrix" | "hackerOne" | "openCollective" | "blueSky" | "discourse" | "zulip" | "pinterest" | "tiktok" | "goodreads" | "hypothesis" | "astro" | "solidjs" | "alpine" | "pnpm" | "biome" | "bun" | "mdx" | "apple" | "linux" | "homebrew" | "nix" | "starlight" | "pkl" | "node" | "cloudflare" | "vercel" | "netlify" | "deno" | "jsr" | "nostr" | "backstage" | "confluence" | "jira" | "storybook" | "vscode" | "jetbrains" | "zed" | "vim" | "figma" | "sketch" | "npm" | "npmx" | "sourcehut" | "substack" | "chrome" | "edge" | "firefox" | "safari" | "seti:folder" | "seti:bsl" | "seti:mdo" | "seti:salesforce" | "seti:asm" | "seti:bicep" | "seti:bazel" | "seti:c" | "seti:c-sharp" | "seti:html" | "seti:cpp" | "seti:clojure" | "seti:coldfusion" | "seti:config" | "seti:crystal" | "seti:crystal_embedded" | "seti:json" | "seti:css" | "seti:csv" | "seti:xls" | "seti:cu" | "seti:cake" | "seti:cake_php" | "seti:d" | "seti:word" | "seti:elixir" | "seti:elixir_script" | "seti:hex" | "seti:elm" | "seti:favicon" | "seti:f-sharp" | "seti:git" | "seti:go" | "seti:godot" | "seti:gradle" | "seti:grails" | "seti:graphql" | "seti:hacklang" | "seti:haml" | "seti:mustache" | "seti:haskell" | "seti:haxe" | "seti:jade" | "seti:java" | "seti:javascript" | "seti:jinja" | "seti:julia" | "seti:karma" | "seti:kotlin" | "seti:dart" | "seti:liquid" | "seti:livescript" | "seti:lua" | "seti:markdown" | "seti:argdown" | "seti:info" | "seti:clock" | "seti:maven" | "seti:nim" | "seti:github" | "seti:notebook" | "seti:nunjucks" | "seti:npm" | "seti:ocaml" | "seti:odata" | "seti:perl" | "seti:php" | "seti:pipeline" | "seti:pddl" | "seti:plan" | "seti:happenings" | "seti:powershell" | "seti:prisma" | "seti:pug" | "seti:puppet" | "seti:purescript" | "seti:python" | "seti:react" | "seti:rescript" | "seti:R" | "seti:ruby" | "seti:rust" | "seti:sass" | "seti:spring" | "seti:slim" | "seti:smarty" | "seti:sbt" | "seti:scala" | "seti:ethereum" | "seti:stylus" | "seti:svelte" | "seti:swift" | "seti:db" | "seti:terraform" | "seti:tex" | "seti:default" | "seti:twig" | "seti:typescript" | "seti:tsconfig" | "seti:vala" | "seti:vite" | "seti:vue" | "seti:wasm" | "seti:wat" | "seti:xml" | "seti:yml" | "seti:prolog" | "seti:zig" | "seti:zip" | "seti:wgt" | "seti:illustrator" | "seti:photoshop" | "seti:pdf" | "seti:font" | "seti:image" | "seti:svg" | "seti:sublime" | "seti:code-search" | "seti:shell" | "seti:video" | "seti:audio" | "seti:windows" | "seti:jenkins" | "seti:babel" | "seti:bower" | "seti:docker" | "seti:code-climate" | "seti:eslint" | "seti:firebase" | "seti:firefox" | "seti:gitlab" | "seti:grunt" | "seti:gulp" | "seti:ionic" | "seti:platformio" | "seti:rollup" | "seti:stylelint" | "seti:yarn" | "seti:webpack" | "seti:lock" | "seti:license" | "seti:makefile" | "seti:heroku" | "seti:todo" | "seti:ignored";
|
|
309
|
+
readonly html?: never;
|
|
310
|
+
} | {
|
|
311
|
+
readonly type: "raw";
|
|
312
|
+
readonly html: string;
|
|
313
|
+
readonly name?: never;
|
|
314
|
+
}, string>>>;
|
|
315
|
+
attrs: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodNumber, z.ZodBoolean]>>>;
|
|
316
|
+
}, z.core.$strip>>>;
|
|
317
|
+
}, z.core.$strip>;
|
|
318
|
+
//#endregion
|
|
319
|
+
export { HeroSchema };
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { IconSchema } from "./icon.js";
|
|
2
|
+
import { z } from "astro/zod";
|
|
3
|
+
//#region src/schemas/hero.ts
|
|
4
|
+
const HeroSchema = ({ image }) => z.object({
|
|
5
|
+
/**
|
|
6
|
+
* The large title text to show. If not provided, will default to the top-level `title`.
|
|
7
|
+
* Can include HTML.
|
|
8
|
+
*/
|
|
9
|
+
title: z.string().optional(),
|
|
10
|
+
/**
|
|
11
|
+
* A short bit of text about your project.
|
|
12
|
+
* Will be displayed in a smaller size below the title.
|
|
13
|
+
*/
|
|
14
|
+
tagline: z.string().optional(),
|
|
15
|
+
/** The image to use in the hero. You can provide either a relative `file` path or raw `html`. */
|
|
16
|
+
image: z.union([
|
|
17
|
+
z.object({
|
|
18
|
+
/** Alt text for screenreaders and other assistive technologies describing your hero image. */
|
|
19
|
+
alt: z.string().default(""),
|
|
20
|
+
/** Relative path to an image file in your repo, e.g. `../../assets/hero.png`. */
|
|
21
|
+
file: image()
|
|
22
|
+
}),
|
|
23
|
+
z.object({
|
|
24
|
+
/** Alt text for screenreaders and other assistive technologies describing your hero image. */
|
|
25
|
+
alt: z.string().default(""),
|
|
26
|
+
/** Relative path to an image file in your repo to use in dark mode, e.g. `../../assets/hero-dark.png`. */
|
|
27
|
+
dark: image(),
|
|
28
|
+
/** Relative path to an image file in your repo to use in light mode, e.g. `../../assets/hero-light.png`. */
|
|
29
|
+
light: image()
|
|
30
|
+
}),
|
|
31
|
+
z.object({
|
|
32
|
+
/** Raw HTML string instead of an image file. Useful for inline SVGs or more complex hero content. */
|
|
33
|
+
html: z.string() }).transform(({ html }) => ({
|
|
34
|
+
html,
|
|
35
|
+
alt: ""
|
|
36
|
+
}))
|
|
37
|
+
]).optional(),
|
|
38
|
+
/** An array of call-to-action links displayed at the bottom of the hero. */
|
|
39
|
+
actions: z.object({
|
|
40
|
+
/** Text label displayed in the link. */
|
|
41
|
+
text: z.string(),
|
|
42
|
+
/** Value for the link’s `href` attribute, e.g. `/page` or `https://mysite.com`. */
|
|
43
|
+
link: z.string(),
|
|
44
|
+
/** Button style to use. One of `primary` (the default), `secondary`, or `minimal`. */
|
|
45
|
+
variant: z.enum([
|
|
46
|
+
"primary",
|
|
47
|
+
"secondary",
|
|
48
|
+
"minimal"
|
|
49
|
+
]).default("primary"),
|
|
50
|
+
/**
|
|
51
|
+
* An optional icon to display alongside the link text.
|
|
52
|
+
* Can be an inline `<svg>` or the name of one of Starlight’s built-in icons.
|
|
53
|
+
*/
|
|
54
|
+
icon: z.union([IconSchema(), z.string().startsWith("<svg")]).transform((icon) => {
|
|
55
|
+
const parsedIcon = IconSchema().safeParse(icon);
|
|
56
|
+
return parsedIcon.success ? {
|
|
57
|
+
type: "icon",
|
|
58
|
+
name: parsedIcon.data
|
|
59
|
+
} : {
|
|
60
|
+
type: "raw",
|
|
61
|
+
html: icon
|
|
62
|
+
};
|
|
63
|
+
}).optional(),
|
|
64
|
+
/** HTML attributes to add to the link */
|
|
65
|
+
attrs: z.record(z.string(), z.union([
|
|
66
|
+
z.string(),
|
|
67
|
+
z.number(),
|
|
68
|
+
z.boolean()
|
|
69
|
+
])).optional()
|
|
70
|
+
}).array().default([])
|
|
71
|
+
});
|
|
72
|
+
//#endregion
|
|
73
|
+
export { HeroSchema };
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { z } from "astro/zod";
|
|
2
|
+
//#region src/schemas/i18n.d.ts
|
|
3
|
+
interface i18nSchemaOpts<T extends z.ZodObject = BaseExtendSchema> {
|
|
4
|
+
/**
|
|
5
|
+
* Extend Starlight’s i18n schema with additional fields.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* // Add two optional fields to the default schema.
|
|
9
|
+
* i18nSchema({
|
|
10
|
+
* extend: z
|
|
11
|
+
* .object({
|
|
12
|
+
* 'customUi.heading': z.string(),
|
|
13
|
+
* 'customUi.text': z.string(),
|
|
14
|
+
* })
|
|
15
|
+
* .partial(),
|
|
16
|
+
* })
|
|
17
|
+
*/
|
|
18
|
+
extend?: T;
|
|
19
|
+
}
|
|
20
|
+
declare const defaultI18nSchema: () => z.ZodObject<{
|
|
21
|
+
'expressiveCode.copyButtonCopied': z.ZodOptional<z.ZodString>;
|
|
22
|
+
'expressiveCode.copyButtonTooltip': z.ZodOptional<z.ZodString>;
|
|
23
|
+
'expressiveCode.terminalWindowFallbackTitle': z.ZodOptional<z.ZodString>;
|
|
24
|
+
'pagefind.clear_search': z.ZodOptional<z.ZodString>;
|
|
25
|
+
'pagefind.load_more': z.ZodOptional<z.ZodString>;
|
|
26
|
+
'pagefind.search_label': z.ZodOptional<z.ZodString>;
|
|
27
|
+
'pagefind.filters_label': z.ZodOptional<z.ZodString>;
|
|
28
|
+
'pagefind.zero_results': z.ZodOptional<z.ZodString>;
|
|
29
|
+
'pagefind.many_results': z.ZodOptional<z.ZodString>;
|
|
30
|
+
'pagefind.one_result': z.ZodOptional<z.ZodString>;
|
|
31
|
+
'pagefind.alt_search': z.ZodOptional<z.ZodString>;
|
|
32
|
+
'pagefind.search_suggestion': z.ZodOptional<z.ZodString>;
|
|
33
|
+
'pagefind.searching': z.ZodOptional<z.ZodString>;
|
|
34
|
+
'skipLink.label': z.ZodOptional<z.ZodString>;
|
|
35
|
+
'search.label': z.ZodOptional<z.ZodString>;
|
|
36
|
+
'search.ctrlKey': z.ZodOptional<z.ZodString>;
|
|
37
|
+
'search.cancelLabel': z.ZodOptional<z.ZodString>;
|
|
38
|
+
'search.devWarning': z.ZodOptional<z.ZodString>;
|
|
39
|
+
'themeSelect.accessibleLabel': z.ZodOptional<z.ZodString>;
|
|
40
|
+
'themeSelect.dark': z.ZodOptional<z.ZodString>;
|
|
41
|
+
'themeSelect.light': z.ZodOptional<z.ZodString>;
|
|
42
|
+
'themeSelect.auto': z.ZodOptional<z.ZodString>;
|
|
43
|
+
'languageSelect.accessibleLabel': z.ZodOptional<z.ZodString>;
|
|
44
|
+
'menuButton.accessibleLabel': z.ZodOptional<z.ZodString>;
|
|
45
|
+
'sidebarNav.accessibleLabel': z.ZodOptional<z.ZodString>;
|
|
46
|
+
'tableOfContents.onThisPage': z.ZodOptional<z.ZodString>;
|
|
47
|
+
'tableOfContents.overview': z.ZodOptional<z.ZodString>;
|
|
48
|
+
'i18n.untranslatedContent': z.ZodOptional<z.ZodString>;
|
|
49
|
+
'page.editLink': z.ZodOptional<z.ZodString>;
|
|
50
|
+
'page.lastUpdated': z.ZodOptional<z.ZodString>;
|
|
51
|
+
'page.previousLink': z.ZodOptional<z.ZodString>;
|
|
52
|
+
'page.nextLink': z.ZodOptional<z.ZodString>;
|
|
53
|
+
'page.draft': z.ZodOptional<z.ZodString>;
|
|
54
|
+
'404.text': z.ZodOptional<z.ZodString>;
|
|
55
|
+
'aside.tip': z.ZodOptional<z.ZodString>;
|
|
56
|
+
'aside.note': z.ZodOptional<z.ZodString>;
|
|
57
|
+
'aside.caution': z.ZodOptional<z.ZodString>;
|
|
58
|
+
'aside.danger': z.ZodOptional<z.ZodString>;
|
|
59
|
+
'fileTree.directory': z.ZodOptional<z.ZodString>;
|
|
60
|
+
'builtWithStarlight.label': z.ZodOptional<z.ZodString>;
|
|
61
|
+
'heading.anchorLabel': z.ZodOptional<z.ZodString>;
|
|
62
|
+
}, z.core.$strip>;
|
|
63
|
+
/** Type of Starlight’s default i18n schema, including extensions from Pagefind and Expressive Code. */
|
|
64
|
+
type DefaultI18nSchema = ReturnType<typeof defaultI18nSchema>;
|
|
65
|
+
/**
|
|
66
|
+
* Based on the the return type of Zod’s `extend()` method. Adds fields from one `z.object()` schema
|
|
67
|
+
* to another.
|
|
68
|
+
* Also sets the resulting schema as “loose” as that’s how we use it. In practice whether or not
|
|
69
|
+
* the types are loose or not doesn’t matter too much.
|
|
70
|
+
*
|
|
71
|
+
* @see https://github.com/colinhacks/zod/blob/9712a6707f3d4584f222729965f3b78f076f0435/packages/zod/src/v4/classic/schemas.ts#L1187
|
|
72
|
+
*/
|
|
73
|
+
type MergeSchemas<A extends z.ZodObject, B extends z.ZodObject> = z.ZodObject<z.util.Extend<A['shape'], B['shape']>, z.core.$loose>;
|
|
74
|
+
/** Type that extends Starlight’s default i18n schema with an optional, user-defined schema. */
|
|
75
|
+
type ExtendedSchema<T extends z.ZodObject> = T extends z.ZodObject ? MergeSchemas<DefaultI18nSchema, T> : DefaultI18nSchema;
|
|
76
|
+
/** Type representing an empty Zod object schema used as the default for the `extend` option. */
|
|
77
|
+
type BaseExtendSchema = z.ZodObject<{}>;
|
|
78
|
+
/** Content collection schema for Starlight’s optional `i18n` collection. */
|
|
79
|
+
declare function i18nSchema<T extends z.ZodObject = BaseExtendSchema>({ extend }?: i18nSchemaOpts<T>): ExtendedSchema<T>;
|
|
80
|
+
type i18nSchemaOutput = z.output<ExtendedSchema<BaseExtendSchema>>;
|
|
81
|
+
declare function builtinI18nSchema(): z.ZodObject<{
|
|
82
|
+
'expressiveCode.copyButtonCopied': z.ZodOptional<z.ZodString>;
|
|
83
|
+
'expressiveCode.copyButtonTooltip': z.ZodOptional<z.ZodString>;
|
|
84
|
+
'expressiveCode.terminalWindowFallbackTitle': z.ZodOptional<z.ZodString>;
|
|
85
|
+
'pagefind.clear_search': z.ZodOptional<z.ZodString>;
|
|
86
|
+
'pagefind.load_more': z.ZodOptional<z.ZodString>;
|
|
87
|
+
'pagefind.search_label': z.ZodOptional<z.ZodString>;
|
|
88
|
+
'pagefind.filters_label': z.ZodOptional<z.ZodString>;
|
|
89
|
+
'pagefind.zero_results': z.ZodOptional<z.ZodString>;
|
|
90
|
+
'pagefind.many_results': z.ZodOptional<z.ZodString>;
|
|
91
|
+
'pagefind.one_result': z.ZodOptional<z.ZodString>;
|
|
92
|
+
'pagefind.alt_search': z.ZodOptional<z.ZodString>;
|
|
93
|
+
'pagefind.search_suggestion': z.ZodOptional<z.ZodString>;
|
|
94
|
+
'pagefind.searching': z.ZodOptional<z.ZodString>;
|
|
95
|
+
'skipLink.label': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
96
|
+
'search.label': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
97
|
+
'search.ctrlKey': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
98
|
+
'search.cancelLabel': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
99
|
+
'search.devWarning': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
100
|
+
'themeSelect.accessibleLabel': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
101
|
+
'themeSelect.dark': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
102
|
+
'themeSelect.light': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
103
|
+
'themeSelect.auto': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
104
|
+
'languageSelect.accessibleLabel': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
105
|
+
'menuButton.accessibleLabel': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
106
|
+
'sidebarNav.accessibleLabel': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
107
|
+
'tableOfContents.onThisPage': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
108
|
+
'tableOfContents.overview': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
109
|
+
'i18n.untranslatedContent': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
110
|
+
'page.editLink': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
111
|
+
'page.lastUpdated': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
112
|
+
'page.previousLink': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
113
|
+
'page.nextLink': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
114
|
+
'page.draft': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
115
|
+
'404.text': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
116
|
+
'aside.tip': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
117
|
+
'aside.note': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
118
|
+
'aside.caution': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
119
|
+
'aside.danger': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
120
|
+
'fileTree.directory': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
121
|
+
'builtWithStarlight.label': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
122
|
+
'heading.anchorLabel': z.ZodNonOptional<z.ZodOptional<z.ZodString>>;
|
|
123
|
+
}, z.core.$strip>;
|
|
124
|
+
//#endregion
|
|
125
|
+
export { builtinI18nSchema, i18nSchema, i18nSchemaOutput };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { z } from "astro/zod";
|
|
2
|
+
//#region src/schemas/i18n.ts
|
|
3
|
+
const defaultI18nSchema = () => z.object({
|
|
4
|
+
...starlightI18nSchema().shape,
|
|
5
|
+
...pagefindI18nSchema().shape,
|
|
6
|
+
...expressiveCodeI18nSchema().shape
|
|
7
|
+
});
|
|
8
|
+
/** Content collection schema for Starlight’s optional `i18n` collection. */
|
|
9
|
+
function i18nSchema({ extend = z.object({}) } = {}) {
|
|
10
|
+
return z.looseObject({
|
|
11
|
+
...defaultI18nSchema().shape,
|
|
12
|
+
...extend.shape
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
function builtinI18nSchema() {
|
|
16
|
+
return z.object({
|
|
17
|
+
...z.strictObject({ ...starlightI18nSchema().required().shape }).shape,
|
|
18
|
+
...pagefindI18nSchema().shape,
|
|
19
|
+
...expressiveCodeI18nSchema().shape
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
function starlightI18nSchema() {
|
|
23
|
+
return z.object({
|
|
24
|
+
"skipLink.label": z.string().meta({ description: "Text displayed in the accessible “Skip link” when a keyboard user first tabs into a page." }),
|
|
25
|
+
"search.label": z.string().meta({ description: "Text displayed in the search bar." }),
|
|
26
|
+
"search.ctrlKey": z.string().meta({ description: "Visible representation of the Control key potentially used in the shortcut key to open the search modal." }),
|
|
27
|
+
"search.cancelLabel": z.string().meta({ description: "Text for the “Cancel” button that closes the search modal." }),
|
|
28
|
+
"search.devWarning": z.string().meta({ description: "Warning displayed when opening the Search in a dev environment." }),
|
|
29
|
+
"themeSelect.accessibleLabel": z.string().meta({ description: "Accessible label for the theme selection dropdown." }),
|
|
30
|
+
"themeSelect.dark": z.string().meta({ description: "Name of the dark color theme." }),
|
|
31
|
+
"themeSelect.light": z.string().meta({ description: "Name of the light color theme." }),
|
|
32
|
+
"themeSelect.auto": z.string().meta({ description: "Name of the automatic color theme that syncs with system preferences." }),
|
|
33
|
+
"languageSelect.accessibleLabel": z.string().meta({ description: "Accessible label for the language selection dropdown." }),
|
|
34
|
+
"menuButton.accessibleLabel": z.string().meta({ description: "Accessible label for the mobile menu button." }),
|
|
35
|
+
"sidebarNav.accessibleLabel": z.string().meta({ description: "Accessible label for the main sidebar `<nav>` element to distinguish it from other `<nav>` landmarks on the page." }),
|
|
36
|
+
"tableOfContents.onThisPage": z.string().meta({ description: "Title for the table of contents component." }),
|
|
37
|
+
"tableOfContents.overview": z.string().meta({ description: "Label used for the first link in the table of contents, linking to the page title." }),
|
|
38
|
+
"i18n.untranslatedContent": z.string().meta({ description: "Notice informing users they are on a page that is not yet translated to their language." }),
|
|
39
|
+
"page.editLink": z.string().meta({ description: "Text for the link to edit a page." }),
|
|
40
|
+
"page.lastUpdated": z.string().meta({ description: "Text displayed in front of the last updated date in the page footer." }),
|
|
41
|
+
"page.previousLink": z.string().meta({ description: "Label shown on the “previous page” pagination arrow in the page footer." }),
|
|
42
|
+
"page.nextLink": z.string().meta({ description: "Label shown on the “next page” pagination arrow in the page footer." }),
|
|
43
|
+
"page.draft": z.string().meta({ description: "Development-only notice informing users they are on a page that is a draft which will not be included in production builds." }),
|
|
44
|
+
"404.text": z.string().meta({ description: "Text shown on Starlight’s default 404 page" }),
|
|
45
|
+
"aside.tip": z.string().meta({ description: "Text shown on the tip aside variant" }),
|
|
46
|
+
"aside.note": z.string().meta({ description: "Text shown on the note aside variant" }),
|
|
47
|
+
"aside.caution": z.string().meta({ description: "Text shown on the warning aside variant" }),
|
|
48
|
+
"aside.danger": z.string().meta({ description: "Text shown on the danger aside variant" }),
|
|
49
|
+
"fileTree.directory": z.string().meta({ description: "Label for the directory icon in the file tree component." }),
|
|
50
|
+
"builtWithStarlight.label": z.string().meta({ description: "Label for the “Built with Starlight” badge optionally displayed in the site footer." }),
|
|
51
|
+
"heading.anchorLabel": z.string().meta({ description: "Label for anchor links in Markdown content." })
|
|
52
|
+
}).partial();
|
|
53
|
+
}
|
|
54
|
+
function pagefindI18nSchema() {
|
|
55
|
+
return z.object({
|
|
56
|
+
"pagefind.clear_search": z.string().meta({ description: "Pagefind UI translation. English default value: `\"Clear\"`. See https://pagefind.app/docs/ui/#translations" }),
|
|
57
|
+
"pagefind.load_more": z.string().meta({ description: "Pagefind UI translation. English default value: `\"Load more results\"`. See https://pagefind.app/docs/ui/#translations" }),
|
|
58
|
+
"pagefind.search_label": z.string().meta({ description: "Pagefind UI translation. English default value: `\"Search this site\"`. See https://pagefind.app/docs/ui/#translations" }),
|
|
59
|
+
"pagefind.filters_label": z.string().meta({ description: "Pagefind UI translation. English default value: `\"Filters\"`. See https://pagefind.app/docs/ui/#translations" }),
|
|
60
|
+
"pagefind.zero_results": z.string().meta({ description: "Pagefind UI translation. English default value: `\"No results for [SEARCH_TERM]\"`. See https://pagefind.app/docs/ui/#translations" }),
|
|
61
|
+
"pagefind.many_results": z.string().meta({ description: "Pagefind UI translation. English default value: `\"[COUNT] results for [SEARCH_TERM]\"`. See https://pagefind.app/docs/ui/#translations" }),
|
|
62
|
+
"pagefind.one_result": z.string().meta({ description: "Pagefind UI translation. English default value: `\"[COUNT] result for [SEARCH_TERM]\"`. See https://pagefind.app/docs/ui/#translations" }),
|
|
63
|
+
"pagefind.alt_search": z.string().meta({ description: "Pagefind UI translation. English default value: `\"No results for [SEARCH_TERM]. Showing results for [DIFFERENT_TERM] instead\"`. See https://pagefind.app/docs/ui/#translations" }),
|
|
64
|
+
"pagefind.search_suggestion": z.string().meta({ description: "Pagefind UI translation. English default value: `\"No results for [SEARCH_TERM]. Try one of the following searches:\"`. See https://pagefind.app/docs/ui/#translations" }),
|
|
65
|
+
"pagefind.searching": z.string().meta({ description: "Pagefind UI translation. English default value: `\"Searching for [SEARCH_TERM]...\"`. See https://pagefind.app/docs/ui/#translations" })
|
|
66
|
+
}).partial();
|
|
67
|
+
}
|
|
68
|
+
function expressiveCodeI18nSchema() {
|
|
69
|
+
return z.object({
|
|
70
|
+
"expressiveCode.copyButtonCopied": z.string().meta({ description: "Expressive Code UI translation. English default value: `\"Copied!\"`" }),
|
|
71
|
+
"expressiveCode.copyButtonTooltip": z.string().meta({ description: "Expressive Code UI translation. English default value: `\"Copy to clipboard\"`" }),
|
|
72
|
+
"expressiveCode.terminalWindowFallbackTitle": z.string().meta({ description: "Expressive Code UI translation. English default value: `\"Terminal window\"`" })
|
|
73
|
+
}).partial();
|
|
74
|
+
}
|
|
75
|
+
//#endregion
|
|
76
|
+
export { builtinI18nSchema, i18nSchema };
|