@dogsbay/ssg 0.2.0-beta.146 → 0.2.0-beta.151
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/package/THIRD-PARTY-NOTICES.txt +11 -5
- package/dist/package/browser.mjs +610 -67
- package/dist/package/chunks/{prebuilt-css-default-GJIN3VOR.mjs → prebuilt-css-default-65IKPMHZ.mjs} +66 -1
- package/dist/package/chunks/{prebuilt-css-mintlify-SKWKD2KB.mjs → prebuilt-css-mintlify-PIEJO5KN.mjs} +66 -1
- package/dist/package/client.mjs +11 -1
- package/dist/package/css.mjs +9 -0
- package/dist/package/types/client/elements.d.ts +1 -0
- package/dist/package/types/core/build.d.ts +19 -7
- package/dist/package/types/core/config.d.ts +46 -4
- package/dist/package/types/core/links.d.ts +15 -0
- package/dist/package/types/theme/compose.d.ts +16 -0
- package/dist/package/types/theme/docs-layout/site-chrome.d.ts +52 -0
- package/dist/package/types/theme/regions.d.ts +9 -2
- package/package.json +29 -29
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type ProductModel } from "@dogsbay/site-files";
|
|
1
|
+
import { type SiteChrome, type ProductModel } from "@dogsbay/site-files";
|
|
2
2
|
export type LinkStyle = "html" | "pretty";
|
|
3
3
|
export type TocMode = "top" | "popover" | "rail" | "off";
|
|
4
4
|
export interface VersionDef {
|
|
@@ -22,6 +22,8 @@ export interface VersionDef {
|
|
|
22
22
|
path?: string;
|
|
23
23
|
/** The version's own banner text (`content.products:` only), instead of the standard one. */
|
|
24
24
|
banner?: string;
|
|
25
|
+
/** Show "Version: <label>" above the title of the version's pages (Docusaurus's version badge). */
|
|
26
|
+
badge?: boolean;
|
|
25
27
|
}
|
|
26
28
|
/** A call into @dogsbay/site-files' product model, its config errors reported as ours (dev and the CLI tell them apart). */
|
|
27
29
|
export declare function shared<T>(f: () => T): T;
|
|
@@ -29,12 +31,27 @@ export declare function shared<T>(f: () => T): T;
|
|
|
29
31
|
export interface ProductVersions {
|
|
30
32
|
versions: VersionDef[];
|
|
31
33
|
defaultVersion?: string;
|
|
34
|
+
/** The version menu's extras: the product's own `versionMenu:`, else the site's. */
|
|
35
|
+
menu?: VersionMenu;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* `versionMenu:` (content, or a product in `content.products:`): links listed after the versions
|
|
39
|
+
* ("All versions" → /archive, Docusaurus's dropdownItemsAfter), and how many versions to list.
|
|
40
|
+
*/
|
|
41
|
+
export interface VersionMenu {
|
|
42
|
+
/** `href` is a site path (`/archive`, `/archive/`) or an http(s) address. */
|
|
43
|
+
links: {
|
|
44
|
+
label: string;
|
|
45
|
+
href: string;
|
|
46
|
+
}[];
|
|
47
|
+
/** List the first `limit` versions (in config order), plus the page's own when it is further down. */
|
|
48
|
+
limit?: number;
|
|
32
49
|
}
|
|
33
50
|
/**
|
|
34
51
|
* A product's versions and default: its own with `content.products:`, else the site-wide `versions:`
|
|
35
52
|
* and `defaultVersion` (the unnamed source's, and every product's without the block).
|
|
36
53
|
*/
|
|
37
|
-
export declare function versionsOf(cfg: Pick<SiteConfig, "versions" | "defaultVersion" | "productVersions">, product: string | undefined): ProductVersions;
|
|
54
|
+
export declare function versionsOf(cfg: Pick<SiteConfig, "versions" | "defaultVersion" | "productVersions" | "versionMenu">, product: string | undefined): ProductVersions;
|
|
38
55
|
export interface LocaleDef {
|
|
39
56
|
id: string;
|
|
40
57
|
label: string;
|
|
@@ -82,7 +99,15 @@ export interface SiteConfig {
|
|
|
82
99
|
basePath: string;
|
|
83
100
|
repoUrl?: string;
|
|
84
101
|
editUri?: string;
|
|
102
|
+
/** Inline Markdown (site-files `inlineMarkdownHtml`), as `chrome.copyright`. */
|
|
85
103
|
copyright?: string;
|
|
104
|
+
/**
|
|
105
|
+
* The site's chrome, read and checked by site-files `siteChrome` for both pipelines: the logo,
|
|
106
|
+
* the first-visit colour mode, the announcement bar, header links and icons, footer columns and
|
|
107
|
+
* icons (`site.logo`, `site.colorMode`, `site.announcement`, `header:`, `footer:`). Its
|
|
108
|
+
* `warnings` are reported by the build. plans/site-chrome.md.
|
|
109
|
+
*/
|
|
110
|
+
chrome: SiteChrome;
|
|
86
111
|
linkStyle: LinkStyle;
|
|
87
112
|
attributes: Record<string, unknown>;
|
|
88
113
|
sources: SourceDef[];
|
|
@@ -90,6 +115,8 @@ export interface SiteConfig {
|
|
|
90
115
|
routablesFrom: "all" | "nav";
|
|
91
116
|
versions: VersionDef[];
|
|
92
117
|
defaultVersion?: string;
|
|
118
|
+
/** `content.versionMenu:` (VersionMenu), for every product without its own. */
|
|
119
|
+
versionMenu?: VersionMenu;
|
|
93
120
|
/** `content.products:`, read by @dogsbay/site-files' `productModel` (plans/product-versions-ssg.md). Undefined without the block. */
|
|
94
121
|
products?: ProductModel;
|
|
95
122
|
/** With `products`: each product's versions and default (key `""` for the unnamed source's), read through `versionsOf`. */
|
|
@@ -131,6 +158,14 @@ export interface SiteConfig {
|
|
|
131
158
|
/** Extra stylesheets, project-relative, appended after the theme. */
|
|
132
159
|
css: string[];
|
|
133
160
|
breadcrumbs: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* UI string overrides (ssg.strings): `{ key: text }` for every language, and `{ <locale>: { key: text } }`
|
|
163
|
+
* for one, which wins. Keys are those of strings.ts.
|
|
164
|
+
*/
|
|
165
|
+
strings: {
|
|
166
|
+
all: Record<string, string>;
|
|
167
|
+
byLocale: Record<string, Record<string, string>>;
|
|
168
|
+
};
|
|
134
169
|
/** Fail the build when a layout or partial reads a variable that does not exist (ssg.strictTemplates). */
|
|
135
170
|
strictTemplates: boolean;
|
|
136
171
|
/** Line under the site name in the sidebar header ("Documentation" in the Astro sites). */
|
|
@@ -181,6 +216,11 @@ export interface SiteConfig {
|
|
|
181
216
|
*/
|
|
182
217
|
dataDir: string;
|
|
183
218
|
dataDirSet: boolean;
|
|
219
|
+
/**
|
|
220
|
+
* `content.static`: a folder served as it is at the site root (Docusaurus `static/`, Astro
|
|
221
|
+
* `public/`), shared with the Astro pipeline (site-files static-folder.ts). Project-relative.
|
|
222
|
+
*/
|
|
223
|
+
staticDir?: string;
|
|
184
224
|
/** Click-to-zoom images, from `plugins: [@dogsbay/plugin-image-zoom]` with its options. */
|
|
185
225
|
imageZoom?: {
|
|
186
226
|
background: string;
|
|
@@ -272,6 +312,8 @@ export interface RedirectDef {
|
|
|
272
312
|
}
|
|
273
313
|
export declare class ConfigError extends Error {
|
|
274
314
|
}
|
|
315
|
+
/** `versionMenu:` (links and limit), read and checked by site-files for both pipelines. */
|
|
316
|
+
export declare function versionMenuOf(raw: unknown, where: string): VersionMenu | undefined;
|
|
275
317
|
export declare function parseConfig(text: string | undefined, overrides?: Partial<SiteConfig>): SiteConfig;
|
|
276
318
|
/**
|
|
277
319
|
* The unit a site path belongs to: the one with the longest prefix that
|
|
@@ -338,8 +380,8 @@ export declare function projectPath(unit: BuildUnit, path: string): string;
|
|
|
338
380
|
export declare const TOPIC_MAP: RegExp;
|
|
339
381
|
/**
|
|
340
382
|
* The project folders and files a build reads: every source's root, the theme folder, extra
|
|
341
|
-
* stylesheets, the folder of each source's own nav file (a topic map's includes sit beside it),
|
|
342
|
-
*
|
|
383
|
+
* stylesheets, the folder of each source's own nav file (a topic map's includes sit beside it), the
|
|
384
|
+
* data folders (the site's, and any source's own; one that does not exist is not read), and the logo files.
|
|
343
385
|
* [""] when a source is the whole project. What the CLI reads from disk, and a dev session watches.
|
|
344
386
|
*/
|
|
345
387
|
export declare function projectRoots(cfg: SiteConfig): string[];
|
|
@@ -24,6 +24,13 @@ export interface LinkTable {
|
|
|
24
24
|
* would silently turn `/1/install` (another version) into this unit's page.
|
|
25
25
|
*/
|
|
26
26
|
stripPrefixes?: string[];
|
|
27
|
+
/**
|
|
28
|
+
* `content.static`: the file a root-absolute link names in the static folder (a site path without
|
|
29
|
+
* its leading slash: `files/x.yaml`, `about/` for `about/index.html`), else undefined. Links from
|
|
30
|
+
* any unit resolve to it, relative to the page's place in the site (`unitPrefix`).
|
|
31
|
+
*/
|
|
32
|
+
staticFile?: (sitePath: string) => string | undefined;
|
|
33
|
+
unitPrefix?: string;
|
|
27
34
|
}
|
|
28
35
|
/** URL for `targetOut` as seen from the page at `fromOut`, both unit-relative files. */
|
|
29
36
|
export declare function hrefBetween(fromOut: string, targetOut: string, style: LinkStyle): string;
|
|
@@ -37,3 +44,11 @@ export declare function createResolver(table: LinkTable, page: {
|
|
|
37
44
|
source: string;
|
|
38
45
|
out: string;
|
|
39
46
|
}): LinkResolver;
|
|
47
|
+
/**
|
|
48
|
+
* A versionMenu or site chrome link as a page writes it: an http(s) address as is; a site path from the page's
|
|
49
|
+
* site root (a leading `basePath` dropped, as redirects do), `/x/` as `x/index.html` and `/x` as
|
|
50
|
+
* `x.html` (a folder's index needs the slash), with pretty links as the site serves them (`x/`, `x`).
|
|
51
|
+
* A file (`.pdf`, `.html`, MENU_FILE) is kept. At the site root the link starts with `./`, so
|
|
52
|
+
* nothing in the path can read as a scheme.
|
|
53
|
+
*/
|
|
54
|
+
export declare function menuHref(href: string, siteRoot: string, style: LinkStyle, basePath?: string): string;
|
|
@@ -68,9 +68,13 @@ export interface PageModel {
|
|
|
68
68
|
updatedDatetime?: string;
|
|
69
69
|
hero?: string;
|
|
70
70
|
};
|
|
71
|
+
/** The product switcher (content.products:); none when absent. */
|
|
72
|
+
products?: R.SwitchOption[];
|
|
71
73
|
versions: R.SwitchOption[];
|
|
72
74
|
locales: R.SwitchOption[];
|
|
73
75
|
banner?: string;
|
|
76
|
+
/** The version's label, when the version has `badge: true`: "Version: <label>" above the title. */
|
|
77
|
+
versionBadge?: string;
|
|
74
78
|
editUrl?: string;
|
|
75
79
|
/** Page URL relative to the page itself, for .md mirror links. */
|
|
76
80
|
mdHref?: string;
|
|
@@ -85,6 +89,11 @@ export interface PageModel {
|
|
|
85
89
|
math?: boolean;
|
|
86
90
|
/** The page's front matter, for templates (`page.meta.*`). */
|
|
87
91
|
meta?: Record<string, unknown>;
|
|
92
|
+
/** The site logo's files as the build wrote them, from the site root (`_dogsbay/site/logo-light.svg`); none without `site.logo` or when it was left out. */
|
|
93
|
+
logo?: {
|
|
94
|
+
light: string;
|
|
95
|
+
dark?: string;
|
|
96
|
+
};
|
|
88
97
|
/** Search-engine and social metadata; see seo.ts. */
|
|
89
98
|
seo?: Omit<SeoInput, "title" | "siteName" | "description" | "headings" | "tags" | "lastUpdated">;
|
|
90
99
|
t: (k: string) => string;
|
|
@@ -96,4 +105,11 @@ export interface PageModel {
|
|
|
96
105
|
* template can only read plain data.
|
|
97
106
|
*/
|
|
98
107
|
export declare function plainData(v: unknown): unknown;
|
|
108
|
+
/**
|
|
109
|
+
* What a reader's close is stored under (`db-announcement-closed:<key>`): the id after the site's
|
|
110
|
+
* URL path and base path, as the Astro pipeline writes it (`/docs#launch-2026`), so sites on one
|
|
111
|
+
* host keep their own. Without either, the site's name: sites published under paths of the Worker,
|
|
112
|
+
* or opened from disk, share an origin too.
|
|
113
|
+
*/
|
|
114
|
+
export declare function announcementKey(cfg: SiteConfig): string;
|
|
99
115
|
export declare function composePage(p: PageModel, cfg: SiteConfig, templates: ThemeTemplates): Promise<string>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The site's chrome as DocsLayout draws it: the `chrome` object format-astro writes into
|
|
3
|
+
* site.json (its `chromeData`), links already carrying the site's prefix, texts already HTML
|
|
4
|
+
* (@dogsbay/site-files inline Markdown), icons already SVG. dogsbay-ssg draws the same keys with
|
|
5
|
+
* its own markup and these classes. See plans/site-chrome.md.
|
|
6
|
+
*/
|
|
7
|
+
export interface SiteChromeLink {
|
|
8
|
+
label: string;
|
|
9
|
+
href: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SiteChromeMenu {
|
|
12
|
+
label: string;
|
|
13
|
+
items: SiteChromeLink[];
|
|
14
|
+
}
|
|
15
|
+
export interface SiteChromeSocial {
|
|
16
|
+
label: string;
|
|
17
|
+
href: string;
|
|
18
|
+
svg: string;
|
|
19
|
+
}
|
|
20
|
+
export interface SiteChromeData {
|
|
21
|
+
colorMode?: "light" | "dark" | "system";
|
|
22
|
+
logo?: {
|
|
23
|
+
light: string;
|
|
24
|
+
dark?: string;
|
|
25
|
+
alt: string;
|
|
26
|
+
replacesName: boolean;
|
|
27
|
+
};
|
|
28
|
+
/** `key` (format-astro): the stored id, with the site's prefix; older site.json files have only `id`. */
|
|
29
|
+
announcement?: {
|
|
30
|
+
id: string;
|
|
31
|
+
key?: string;
|
|
32
|
+
html: string;
|
|
33
|
+
tone: string;
|
|
34
|
+
closeable: boolean;
|
|
35
|
+
};
|
|
36
|
+
header?: {
|
|
37
|
+
links: Array<SiteChromeLink | SiteChromeMenu>;
|
|
38
|
+
social: SiteChromeSocial[];
|
|
39
|
+
};
|
|
40
|
+
footer?: {
|
|
41
|
+
columns: Array<{
|
|
42
|
+
title: string;
|
|
43
|
+
links: SiteChromeLink[];
|
|
44
|
+
}>;
|
|
45
|
+
social: SiteChromeSocial[];
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export declare const isMenu: (l: SiteChromeLink | SiteChromeMenu) => l is SiteChromeMenu;
|
|
49
|
+
/** An http(s) address on another site: opened as the version menu's are, in the same tab, marked external for link icons. */
|
|
50
|
+
export declare const isExternal: (href: string) => boolean;
|
|
51
|
+
/** The announcement's colours by tone: the callout tokens, so the theme and dark mode apply. */
|
|
52
|
+
export declare const ANNOUNCEMENT_TONE_CLASS: Record<string, string>;
|
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
import type { NavNode } from "../core/nav.js";
|
|
2
|
-
/** Icons the region partials place (pager chevrons, the "Powered by" mark). */
|
|
2
|
+
/** Icons the region partials place (pager chevrons, the "Powered by" mark, the header menus' chevron, the announcement's close). */
|
|
3
3
|
export declare const ICONS: {
|
|
4
|
+
chevronDown: string;
|
|
5
|
+
close: string;
|
|
4
6
|
chevronLeft: string;
|
|
5
7
|
chevronRight: string;
|
|
6
8
|
layers: string;
|
|
7
9
|
};
|
|
8
10
|
export declare const BOOK_ICON: string;
|
|
11
|
+
/** `links`: the header's links as a list, shown here below lg (DocsLayout's SidebarGroup with HeaderLinks layout="list"). */
|
|
9
12
|
export declare function sidebar(opts: {
|
|
10
13
|
header: string;
|
|
11
14
|
nav: string;
|
|
12
15
|
label: string;
|
|
16
|
+
links?: string;
|
|
13
17
|
}): string;
|
|
14
18
|
export declare function sidebarTrigger(label: string): string;
|
|
15
19
|
export interface NavOptions {
|
|
@@ -52,13 +56,16 @@ export declare function compactNav(nodes: NavNode[], href: (slug: string) => str
|
|
|
52
56
|
export declare function navSize(nodes: NavNode[]): number;
|
|
53
57
|
export declare function searchButton(label: string): string;
|
|
54
58
|
export declare function themeToggle(label: string): string;
|
|
55
|
-
export declare function repoLink(url: string, label: string): string;
|
|
56
59
|
export interface SwitchOption {
|
|
57
60
|
label: string;
|
|
58
61
|
href: string;
|
|
59
62
|
current: boolean;
|
|
60
63
|
prefix: string;
|
|
61
64
|
note?: string;
|
|
65
|
+
/** Shown but not choosable: the product switcher's "none" entry on a page outside every product. */
|
|
66
|
+
disabled?: boolean;
|
|
67
|
+
/** A versionMenu link after the versions: the client goes straight to it. */
|
|
68
|
+
link?: boolean;
|
|
62
69
|
}
|
|
63
70
|
export declare function pageActions(o: {
|
|
64
71
|
mdHref: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dogsbay/ssg",
|
|
3
|
-
"version": "0.2.0-beta.
|
|
3
|
+
"version": "0.2.0-beta.151",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Documentation static site generator for Dogsbay-MD that builds inside Cloudflare Workers and publishes sites that work offline",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -49,38 +49,38 @@
|
|
|
49
49
|
"tailwindcss": "^4.3.2"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
|
-
"@dogsbay/elements": "0.2.0-beta.
|
|
53
|
-
"@dogsbay/format-dogsbay-md": "0.2.0-beta.
|
|
54
|
-
"@dogsbay/format-openapi": "0.2.0-beta.
|
|
55
|
-
"@dogsbay/format-topicmap": "0.2.0-beta.
|
|
56
|
-
"@dogsbay/highlight": "0.2.0-beta.
|
|
57
|
-
"@dogsbay/minja": "0.2.0-beta.
|
|
58
|
-
"@dogsbay/primitives": "0.2.0-beta.
|
|
59
|
-
"@dogsbay/render-html": "0.2.0-beta.
|
|
60
|
-
"@dogsbay/search": "0.2.0-beta.
|
|
61
|
-
"@dogsbay/serialize-core": "0.2.0-beta.
|
|
62
|
-
"@dogsbay/site-check": "0.2.0-beta.
|
|
63
|
-
"@dogsbay/site-files": "0.2.0-beta.
|
|
64
|
-
"@dogsbay/types": "0.2.0-beta.
|
|
52
|
+
"@dogsbay/elements": "0.2.0-beta.151",
|
|
53
|
+
"@dogsbay/format-dogsbay-md": "0.2.0-beta.151",
|
|
54
|
+
"@dogsbay/format-openapi": "0.2.0-beta.151",
|
|
55
|
+
"@dogsbay/format-topicmap": "0.2.0-beta.151",
|
|
56
|
+
"@dogsbay/highlight": "0.2.0-beta.151",
|
|
57
|
+
"@dogsbay/minja": "0.2.0-beta.151",
|
|
58
|
+
"@dogsbay/primitives": "0.2.0-beta.151",
|
|
59
|
+
"@dogsbay/render-html": "0.2.0-beta.151",
|
|
60
|
+
"@dogsbay/search": "0.2.0-beta.151",
|
|
61
|
+
"@dogsbay/serialize-core": "0.2.0-beta.151",
|
|
62
|
+
"@dogsbay/site-check": "0.2.0-beta.151",
|
|
63
|
+
"@dogsbay/site-files": "0.2.0-beta.151",
|
|
64
|
+
"@dogsbay/types": "0.2.0-beta.151"
|
|
65
65
|
},
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@axe-core/playwright": "^4.12.1",
|
|
68
68
|
"@cloudflare/workers-types": "^5.20260921.1",
|
|
69
|
-
"@dogsbay/elements": "0.2.0-beta.
|
|
70
|
-
"@dogsbay/format-dogsbay-md": "0.2.0-beta.
|
|
71
|
-
"@dogsbay/format-openapi": "0.2.0-beta.
|
|
72
|
-
"@dogsbay/format-topicmap": "0.2.0-beta.
|
|
73
|
-
"@dogsbay/highlight": "0.2.0-beta.
|
|
74
|
-
"@dogsbay/icons": "0.2.0-beta.
|
|
75
|
-
"@dogsbay/minja": "0.2.0-beta.
|
|
76
|
-
"@dogsbay/primitives": "0.2.0-beta.
|
|
77
|
-
"@dogsbay/render-html": "0.2.0-beta.
|
|
78
|
-
"@dogsbay/search": "0.2.0-beta.
|
|
79
|
-
"@dogsbay/serialize-core": "0.2.0-beta.
|
|
80
|
-
"@dogsbay/site-check": "0.2.0-beta.
|
|
81
|
-
"@dogsbay/site-files": "0.2.0-beta.
|
|
82
|
-
"@dogsbay/types": "0.2.0-beta.
|
|
83
|
-
"@dogsbay/ui": "0.2.0-beta.
|
|
69
|
+
"@dogsbay/elements": "0.2.0-beta.151",
|
|
70
|
+
"@dogsbay/format-dogsbay-md": "0.2.0-beta.151",
|
|
71
|
+
"@dogsbay/format-openapi": "0.2.0-beta.151",
|
|
72
|
+
"@dogsbay/format-topicmap": "0.2.0-beta.151",
|
|
73
|
+
"@dogsbay/highlight": "0.2.0-beta.151",
|
|
74
|
+
"@dogsbay/icons": "0.2.0-beta.151",
|
|
75
|
+
"@dogsbay/minja": "0.2.0-beta.151",
|
|
76
|
+
"@dogsbay/primitives": "0.2.0-beta.151",
|
|
77
|
+
"@dogsbay/render-html": "0.2.0-beta.151",
|
|
78
|
+
"@dogsbay/search": "0.2.0-beta.151",
|
|
79
|
+
"@dogsbay/serialize-core": "0.2.0-beta.151",
|
|
80
|
+
"@dogsbay/site-check": "0.2.0-beta.151",
|
|
81
|
+
"@dogsbay/site-files": "0.2.0-beta.151",
|
|
82
|
+
"@dogsbay/types": "0.2.0-beta.151",
|
|
83
|
+
"@dogsbay/ui": "0.2.0-beta.151",
|
|
84
84
|
"@mermanjs/web": "0.7.0",
|
|
85
85
|
"@playwright/test": "1.61.1",
|
|
86
86
|
"@types/node": "^22.10.0",
|