@levino/shipyard-docs 0.8.1-rc-20260509110053 → 0.8.1
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/astro/Layout.astro +12 -3
- package/package.json +2 -2
- package/src/index.ts +10 -4
package/astro/Layout.astro
CHANGED
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
VersionSelector,
|
|
12
12
|
} from '@levino/shipyard-base/components'
|
|
13
13
|
import BaseLayout from '@levino/shipyard-base/layouts/Page.astro'
|
|
14
|
+
import type { ImageMetadata } from 'astro'
|
|
14
15
|
import { experimental_AstroContainer as AstroContainer } from 'astro/container'
|
|
15
16
|
import { Array as EffectArray, Option } from 'effect'
|
|
16
17
|
import { getPaginationInfo } from '../src/pagination'
|
|
@@ -66,9 +67,11 @@ interface Props {
|
|
|
66
67
|
*/
|
|
67
68
|
keywords?: string[]
|
|
68
69
|
/**
|
|
69
|
-
* Social preview image URL
|
|
70
|
+
* Social preview image. Accepts an absolute URL or, in content collections,
|
|
71
|
+
* an `ImageMetadata` from a relative path. Local images are automatically
|
|
72
|
+
* optimized to 1200×630 JPEG for OG/Twitter cards.
|
|
70
73
|
*/
|
|
71
|
-
image?: string
|
|
74
|
+
image?: string | ImageMetadata
|
|
72
75
|
/**
|
|
73
76
|
* Custom canonical URL for the page.
|
|
74
77
|
*/
|
|
@@ -86,6 +89,11 @@ interface Props {
|
|
|
86
89
|
* Override title for SEO/browser tab (overrides the regular title in <title> tag).
|
|
87
90
|
*/
|
|
88
91
|
titleMeta?: string
|
|
92
|
+
/**
|
|
93
|
+
* Page description used for `<meta name="description">` and as the default
|
|
94
|
+
* for `og:image:alt` / `twitter:image:alt`.
|
|
95
|
+
*/
|
|
96
|
+
description?: string
|
|
89
97
|
}
|
|
90
98
|
|
|
91
99
|
const {
|
|
@@ -103,6 +111,7 @@ const {
|
|
|
103
111
|
canonicalUrl,
|
|
104
112
|
customMetaTags,
|
|
105
113
|
titleMeta,
|
|
114
|
+
description,
|
|
106
115
|
} = Astro.props
|
|
107
116
|
|
|
108
117
|
// Normalize the route base path
|
|
@@ -318,7 +327,7 @@ const deprecationBannerProps =
|
|
|
318
327
|
: null
|
|
319
328
|
---
|
|
320
329
|
|
|
321
|
-
<BaseLayout sidebarNavigation={entries} keywords={keywords} image={image} canonicalUrl={canonicalUrl} customMetaTags={customMetaTags} title={titleMeta}>
|
|
330
|
+
<BaseLayout sidebarNavigation={entries} keywords={keywords} image={image} canonicalUrl={canonicalUrl} customMetaTags={customMetaTags} title={titleMeta} description={description}>
|
|
322
331
|
{
|
|
323
332
|
versionSelectorProps && (
|
|
324
333
|
<VersionSelector
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@levino/shipyard-docs",
|
|
3
|
-
"version": "0.8.1
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Documentation plugin for shipyard with automatic sidebar, pagination, and git metadata",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.ts",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"effect": "^3.20.0",
|
|
28
28
|
"ramda": "^0.31",
|
|
29
29
|
"unist-util-visit": "^5.0.0",
|
|
30
|
-
"@levino/shipyard-base": "0.8.1
|
|
30
|
+
"@levino/shipyard-base": "^0.8.1"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@tailwindcss/typography": "^0.5.16",
|
package/src/index.ts
CHANGED
|
@@ -86,8 +86,14 @@ const docsSchemaBase = (image: () => z.ZodType) =>
|
|
|
86
86
|
description: z.string().optional(),
|
|
87
87
|
/** SEO keywords */
|
|
88
88
|
keywords: z.array(z.string()).optional(),
|
|
89
|
-
/**
|
|
90
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Social preview image. Accepts either:
|
|
91
|
+
* - A relative path to a local image file (e.g. `./hero.png`), which is
|
|
92
|
+
* automatically optimized to 1200×630 JPEG for OG/Twitter cards.
|
|
93
|
+
* - An absolute URL (e.g. `https://example.com/og.jpg`), passed through
|
|
94
|
+
* verbatim.
|
|
95
|
+
*/
|
|
96
|
+
image: z.union([image(), z.string().url()]).optional(),
|
|
91
97
|
/** Custom canonical URL */
|
|
92
98
|
canonicalUrl: z.string().optional(),
|
|
93
99
|
/** Custom canonical URL - snake_case alias for Docusaurus compatibility */
|
|
@@ -1015,7 +1021,7 @@ const displayVersion = version // The version shown in the URL
|
|
|
1015
1021
|
|
|
1016
1022
|
const { Content, headings } = await render(entry)
|
|
1017
1023
|
|
|
1018
|
-
const { customEditUrl, lastUpdateAuthor, lastUpdateTime, hideTableOfContents, hideTitle, keywords, image, canonicalUrl, customMetaTags, title_meta: titleMeta } = entry.data
|
|
1024
|
+
const { customEditUrl, lastUpdateAuthor, lastUpdateTime, hideTableOfContents, hideTitle, keywords, image, canonicalUrl, customMetaTags, title_meta: titleMeta, description } = entry.data
|
|
1019
1025
|
|
|
1020
1026
|
let editUrl
|
|
1021
1027
|
if (customEditUrl === null) {
|
|
@@ -1065,7 +1071,7 @@ if (
|
|
|
1065
1071
|
}
|
|
1066
1072
|
---
|
|
1067
1073
|
|
|
1068
|
-
<Layout headings={headings} routeBasePath={routeBasePath} editUrl={editUrl} lastUpdated={lastUpdated} lastAuthor={lastAuthor} hideTableOfContents={hideTableOfContents} hideTitle={hideTitle} keywords={keywords} image={image
|
|
1074
|
+
<Layout headings={headings} routeBasePath={routeBasePath} editUrl={editUrl} lastUpdated={lastUpdated} lastAuthor={lastAuthor} hideTableOfContents={hideTableOfContents} hideTitle={hideTitle} keywords={keywords} image={image} canonicalUrl={canonicalUrl} customMetaTags={customMetaTags} titleMeta={titleMeta} description={description}>
|
|
1069
1075
|
<Content />
|
|
1070
1076
|
</Layout>
|
|
1071
1077
|
`
|