@knitli/docs-components 1.1.11 → 1.2.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/dist/data/products.d.ts +44 -0
- package/dist/data/products.d.ts.map +1 -0
- package/dist/data/products.js +38 -0
- package/dist/data/products.json +45 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -1
- package/dist/types/index.d.ts +2 -6
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +13 -5
- package/src/components/AllContributors.astro +38 -0
- package/src/components/Contributors.astro +30 -0
- package/src/components/DocsBreadcrumb.astro +2 -1
- package/src/components/Footer.astro +22 -32
- package/src/components/PageFrame.astro +1 -5
- package/src/components/ProductCard.astro +289 -0
- package/src/components/ProductGrid.astro +54 -0
- package/src/components/ProductShowcase.astro +22 -0
- package/src/components/SeoMeta.astro +53 -0
- package/src/data/products.json +45 -0
- package/src/data/products.ts +79 -0
- package/src/index.ts +10 -1
- package/src/types/index.ts +4 -6
- package/src/templates/AstroConfigTemplate.mjs +0 -324
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type ProductStatus = "available" | "coming-soon" | "alpha" | "beta";
|
|
2
|
+
export interface Product {
|
|
3
|
+
/** URL slug used in docs paths, e.g. "recoco" */
|
|
4
|
+
slug: string;
|
|
5
|
+
/** Display name */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Short tagline for cards/nav */
|
|
8
|
+
tagline: string;
|
|
9
|
+
/** Primary description */
|
|
10
|
+
description: string;
|
|
11
|
+
/** Bold/emphasized callout text */
|
|
12
|
+
highlight?: string;
|
|
13
|
+
/** Italicized footnote (e.g. "Now in Alpha.") */
|
|
14
|
+
footnote?: string;
|
|
15
|
+
/** Product status — drives card rendering and footer links */
|
|
16
|
+
status: ProductStatus;
|
|
17
|
+
/** Docs URL — relative for hosted docs, absolute for external */
|
|
18
|
+
docsUrl?: string;
|
|
19
|
+
/** Whether docs are hosted externally (e.g. docs.rs) */
|
|
20
|
+
external?: boolean;
|
|
21
|
+
/** Logo asset key from DocsAssets */
|
|
22
|
+
logo: string;
|
|
23
|
+
/** Dark-mode logo asset key from DocsAssets */
|
|
24
|
+
darkLogo?: string;
|
|
25
|
+
/** Sort order for display */
|
|
26
|
+
order: number;
|
|
27
|
+
/** Set false to hide from docs-home without deleting */
|
|
28
|
+
featured?: boolean;
|
|
29
|
+
}
|
|
30
|
+
/** All products from the catalog */
|
|
31
|
+
export declare const products: Product[];
|
|
32
|
+
/** Products marked as featured (or not explicitly unfeatured), sorted by order */
|
|
33
|
+
export declare function featuredProducts(): Product[];
|
|
34
|
+
/** Products with available documentation (not coming-soon) */
|
|
35
|
+
export declare function availableProducts(): Product[];
|
|
36
|
+
/** Look up a single product by slug */
|
|
37
|
+
export declare function getProduct(slug: string): Product | undefined;
|
|
38
|
+
/** Look up a product by display name */
|
|
39
|
+
export declare function getProductByName(name: string): Product | undefined;
|
|
40
|
+
/** All valid product display names, derived from catalog */
|
|
41
|
+
export declare function productNames(): string[];
|
|
42
|
+
/** Generate sitemap URLs for products with hosted (non-external) docs */
|
|
43
|
+
export declare function getProductSitemaps(baseUrl?: string): string[];
|
|
44
|
+
//# sourceMappingURL=products.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"products.d.ts","sourceRoot":"","sources":["../../src/data/products.ts"],"names":[],"mappings":"AAUA,MAAM,MAAM,aAAa,GAAG,WAAW,GAAG,aAAa,GAAG,OAAO,GAAG,MAAM,CAAC;AAE3E,MAAM,WAAW,OAAO;IACtB,iDAAiD;IACjD,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,0BAA0B;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,8DAA8D;IAC9D,MAAM,EAAE,aAAa,CAAC;IACtB,iEAAiE;IACjE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,wDAAwD;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,qCAAqC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,+CAA+C;IAC/C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6BAA6B;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,wDAAwD;IACxD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,oCAAoC;AACpC,eAAO,MAAM,QAAQ,EAAE,OAAO,EAA6B,CAAC;AAE5D,kFAAkF;AAClF,wBAAgB,gBAAgB,IAAI,OAAO,EAAE,CAI5C;AAED,8DAA8D;AAC9D,wBAAgB,iBAAiB,IAAI,OAAO,EAAE,CAE7C;AAED,uCAAuC;AACvC,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAE5D;AAED,wCAAwC;AACxC,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,GAAG,SAAS,CAElE;AAED,4DAA4D;AAC5D,wBAAgB,YAAY,IAAI,MAAM,EAAE,CAEvC;AAED,yEAAyE;AACzE,wBAAgB,kBAAkB,CAChC,OAAO,SAA4B,GAClC,MAAM,EAAE,CAIV"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2025 Knitli Inc.
|
|
2
|
+
// SPDX-FileContributor: Adam Poulemanos <adam@knit.li>
|
|
3
|
+
//
|
|
4
|
+
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
5
|
+
//
|
|
6
|
+
// Product catalog — single source of truth for all Knitli product metadata.
|
|
7
|
+
// Edit products.json to add, remove, reorder, or update products.
|
|
8
|
+
import catalogData from "./products.json" with { type: "json" };
|
|
9
|
+
/** All products from the catalog */
|
|
10
|
+
export const products = catalogData;
|
|
11
|
+
/** Products marked as featured (or not explicitly unfeatured), sorted by order */
|
|
12
|
+
export function featuredProducts() {
|
|
13
|
+
return products
|
|
14
|
+
.filter((p) => p.featured !== false)
|
|
15
|
+
.sort((a, b) => a.order - b.order);
|
|
16
|
+
}
|
|
17
|
+
/** Products with available documentation (not coming-soon) */
|
|
18
|
+
export function availableProducts() {
|
|
19
|
+
return products.filter((p) => p.status !== "coming-soon");
|
|
20
|
+
}
|
|
21
|
+
/** Look up a single product by slug */
|
|
22
|
+
export function getProduct(slug) {
|
|
23
|
+
return products.find((p) => p.slug === slug);
|
|
24
|
+
}
|
|
25
|
+
/** Look up a product by display name */
|
|
26
|
+
export function getProductByName(name) {
|
|
27
|
+
return products.find((p) => p.name === name);
|
|
28
|
+
}
|
|
29
|
+
/** All valid product display names, derived from catalog */
|
|
30
|
+
export function productNames() {
|
|
31
|
+
return products.map((p) => p.name);
|
|
32
|
+
}
|
|
33
|
+
/** Generate sitemap URLs for products with hosted (non-external) docs */
|
|
34
|
+
export function getProductSitemaps(baseUrl = "https://docs.knitli.com") {
|
|
35
|
+
return products
|
|
36
|
+
.filter((p) => p.docsUrl && !p.external && p.status !== "coming-soon")
|
|
37
|
+
.map((p) => `${baseUrl}/${p.slug}/sitemap-index.xml`);
|
|
38
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
[
|
|
2
|
+
{
|
|
3
|
+
"slug": "recoco",
|
|
4
|
+
"name": "Recoco",
|
|
5
|
+
"tagline": "Intelligent data pipelines",
|
|
6
|
+
"description": "Build intelligent data pipelines and ETL workflows. Only process changed data.",
|
|
7
|
+
"highlight": "Pure Rust, minimal dependencies, maximum efficiency.",
|
|
8
|
+
"status": "available",
|
|
9
|
+
"docsUrl": "/recoco/",
|
|
10
|
+
"external": false,
|
|
11
|
+
"logo": "recocoLogoSm",
|
|
12
|
+
"darkLogo": "recocoLogoSm",
|
|
13
|
+
"order": 1,
|
|
14
|
+
"featured": true
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"slug": "codeweaver",
|
|
18
|
+
"name": "CodeWeaver",
|
|
19
|
+
"tagline": "AI code context engine",
|
|
20
|
+
"description": "Your AI code assistants can do better.",
|
|
21
|
+
"highlight": "CodeWeaver gives AI agents tailored code context and project understanding, stopping hallucinations, cutting token waste, and supercharging your AI coding workflows.",
|
|
22
|
+
"footnote": "Now in Alpha.",
|
|
23
|
+
"status": "coming-soon",
|
|
24
|
+
"external": false,
|
|
25
|
+
"logo": "codeweaverPrimary",
|
|
26
|
+
"darkLogo": "codeweaverReverse",
|
|
27
|
+
"order": 2,
|
|
28
|
+
"featured": true
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"slug": "thread",
|
|
32
|
+
"name": "Thread",
|
|
33
|
+
"tagline": "Ultra-fast codebase analysis",
|
|
34
|
+
"description": "An ultra-fast, Rust-native, codebase analysis platform.",
|
|
35
|
+
"highlight": "Real-time code understanding and navigation for the largest codebases. Delivers 50x+ speed improvements over comparable tools with minimal resource usage. Works locally, on the edge, or in the cloud.",
|
|
36
|
+
"footnote": "Limited features available now, full release coming soon.",
|
|
37
|
+
"status": "available",
|
|
38
|
+
"docsUrl": "https://docs.rs/thread",
|
|
39
|
+
"external": true,
|
|
40
|
+
"logo": "threadLogoLight",
|
|
41
|
+
"darkLogo": "threadLogoDark",
|
|
42
|
+
"order": 3,
|
|
43
|
+
"featured": true
|
|
44
|
+
}
|
|
45
|
+
]
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
export * from "./data/products.js";
|
|
1
2
|
export * from "./types/index.js";
|
|
2
3
|
export declare const DocsAssets: {
|
|
3
4
|
knitliLogo: string;
|
|
@@ -43,6 +44,12 @@ declare const _default: {
|
|
|
43
44
|
DocsBreadcrumb: () => Promise<typeof import("*.astro")>;
|
|
44
45
|
DocsFooter: () => Promise<typeof import("*.astro")>;
|
|
45
46
|
PageFrame: () => Promise<typeof import("*.astro")>;
|
|
47
|
+
Contributors: () => Promise<typeof import("*.astro")>;
|
|
48
|
+
AllContributors: () => Promise<typeof import("*.astro")>;
|
|
49
|
+
SeoMeta: () => Promise<typeof import("*.astro")>;
|
|
50
|
+
ProductCard: () => Promise<typeof import("*.astro")>;
|
|
51
|
+
ProductGrid: () => Promise<typeof import("*.astro")>;
|
|
52
|
+
ProductShowcase: () => Promise<typeof import("*.astro")>;
|
|
46
53
|
};
|
|
47
54
|
export default _default;
|
|
48
55
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAOA,cAAc,oBAAoB,CAAC;AAEnC,cAAc,kBAAkB,CAAC;AAuBjC,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;CAmBtB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBF,wBAGE"}
|
package/dist/index.js
CHANGED
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
5
5
|
//
|
|
6
6
|
// Main exports for @knitli/docs-components package
|
|
7
|
-
|
|
7
|
+
export * from "./data/products.js";
|
|
8
|
+
// Export type definitions and product catalog
|
|
8
9
|
export * from "./types/index.js";
|
|
9
10
|
import { faviconIco, faviconSvg } from "./assets/favicon/index.js";
|
|
10
11
|
import { codeweaverPrimary, codeweaverReverse, headlineLogoDark, headlineLogoLight, knitliLogo, knitliWordmark, recocoLogoLg, recocoLogoMed, recocoLogoSm, recocoLogoXl, recocoLogoXs, threadLogoDark, threadLogoLight, } from "./assets/logos/index.js";
|
|
@@ -34,6 +35,12 @@ const components = {
|
|
|
34
35
|
DocsBreadcrumb: async () => await import("./components/DocsBreadcrumb.astro"),
|
|
35
36
|
DocsFooter: async () => await import("./components/Footer.astro"),
|
|
36
37
|
PageFrame: async () => await import("./components/PageFrame.astro"),
|
|
38
|
+
Contributors: async () => await import("./components/Contributors.astro"),
|
|
39
|
+
AllContributors: async () => await import("./components/AllContributors.astro"),
|
|
40
|
+
SeoMeta: async () => await import("./components/SeoMeta.astro"),
|
|
41
|
+
ProductCard: async () => await import("./components/ProductCard.astro"),
|
|
42
|
+
ProductGrid: async () => await import("./components/ProductGrid.astro"),
|
|
43
|
+
ProductShowcase: async () => await import("./components/ProductShowcase.astro"),
|
|
37
44
|
};
|
|
38
45
|
export default {
|
|
39
46
|
...components,
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Supported Knitli products for documentation
|
|
3
|
-
*/
|
|
4
|
-
export type ProductName = "Recoco" | "CodeWeaver" | "Thread";
|
|
5
1
|
/**
|
|
6
2
|
* Site URLs configuration
|
|
7
3
|
*/
|
|
@@ -17,7 +13,7 @@ export interface DocsBreadcrumbProps {
|
|
|
17
13
|
/**
|
|
18
14
|
* Current product name
|
|
19
15
|
*/
|
|
20
|
-
product?:
|
|
16
|
+
product?: string;
|
|
21
17
|
/**
|
|
22
18
|
* URL to the product's documentation home
|
|
23
19
|
*/
|
|
@@ -30,6 +26,6 @@ export interface DocsBreadcrumbProps {
|
|
|
30
26
|
* Visual variant of the breadcrumb
|
|
31
27
|
* @default 'default'
|
|
32
28
|
*/
|
|
33
|
-
variant?: "default" | "compact";
|
|
29
|
+
variant?: "default" | "compact" | "inline";
|
|
34
30
|
}
|
|
35
31
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAUA;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;CAC5C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@knitli/docs-components",
|
|
3
|
-
"version": "1.1
|
|
3
|
+
"version": "1.2.1",
|
|
4
4
|
"description": "Shared branded components for Knitli documentation sites",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"knitli",
|
|
@@ -26,6 +26,13 @@
|
|
|
26
26
|
"./DocsBreadcrumb.astro": "./src/components/DocsBreadcrumb.astro",
|
|
27
27
|
"./Footer.astro": "./src/components/Footer.astro",
|
|
28
28
|
"./PageFrame.astro": "./src/components/PageFrame.astro",
|
|
29
|
+
"./Contributors.astro": "./src/components/Contributors.astro",
|
|
30
|
+
"./AllContributors.astro": "./src/components/AllContributors.astro",
|
|
31
|
+
"./SeoMeta.astro": "./src/components/SeoMeta.astro",
|
|
32
|
+
"./ProductCard.astro": "./src/components/ProductCard.astro",
|
|
33
|
+
"./ProductGrid.astro": "./src/components/ProductGrid.astro",
|
|
34
|
+
"./ProductShowcase.astro": "./src/components/ProductShowcase.astro",
|
|
35
|
+
"./products": "./src/data/products.ts",
|
|
29
36
|
"./custom.css": "./src/styles/custom.css",
|
|
30
37
|
"./assets/logos/*": "./src/assets/logos/*",
|
|
31
38
|
"./assets/styles/*": "./src/assets/styles/*"
|
|
@@ -42,9 +49,11 @@
|
|
|
42
49
|
"scripts": {
|
|
43
50
|
"build": "bunx tsc && bun run copy-assets",
|
|
44
51
|
"copy-assets": "bun run scripts/copy-assets.mjs",
|
|
45
|
-
"prepublishOnly": "bun run copy-assets && bun run build"
|
|
46
|
-
|
|
47
|
-
|
|
52
|
+
"prepublishOnly": "bun run copy-assets && bun run build"
|
|
53
|
+
},
|
|
54
|
+
"dependencies": {
|
|
55
|
+
"astro-contributors": "catalog:astro-plugins",
|
|
56
|
+
"astro-seo-meta": "catalog:astro-plugins"
|
|
48
57
|
},
|
|
49
58
|
"devDependencies": {
|
|
50
59
|
"@biomejs/biome": "catalog:dev-common",
|
|
@@ -54,7 +63,6 @@
|
|
|
54
63
|
"@types/node": "catalog:types",
|
|
55
64
|
"@types/react": "catalog:types",
|
|
56
65
|
"astro": "catalog:astro-core",
|
|
57
|
-
"auto-changelog": "^2.4.0",
|
|
58
66
|
"bun": "catalog:dev-common",
|
|
59
67
|
"lightningcss": "catalog:optimization",
|
|
60
68
|
"svgo": "catalog:optimization",
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
---
|
|
2
|
+
// SPDX-FileCopyrightText: 2026 Knitli Inc.
|
|
3
|
+
// SPDX-FileContributor: Adam Poulemanos <adam@knit.li>
|
|
4
|
+
//
|
|
5
|
+
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
6
|
+
//
|
|
7
|
+
// Knitli-branded wrapper around astro-contributors AllContributors grid.
|
|
8
|
+
// Reads from .all-contributorsrc and pre-applies brand colors.
|
|
9
|
+
//
|
|
10
|
+
// Usage:
|
|
11
|
+
// <AllContributors />
|
|
12
|
+
|
|
13
|
+
import { AllContributors as BaseAllContributors } from "astro-contributors";
|
|
14
|
+
|
|
15
|
+
export interface Props {
|
|
16
|
+
/** Focus/accent color for hover outlines */
|
|
17
|
+
focusColor?: string;
|
|
18
|
+
/** Card background color */
|
|
19
|
+
bgColor?: string;
|
|
20
|
+
/** Card border color */
|
|
21
|
+
borderColor?: string;
|
|
22
|
+
/** Primary text color */
|
|
23
|
+
textColor?: string;
|
|
24
|
+
/** Contribution badge background color */
|
|
25
|
+
badgeBgColor?: string;
|
|
26
|
+
/** Contribution badge text color */
|
|
27
|
+
badgeTextColor?: string;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const {
|
|
31
|
+
focusColor = "var(--sl-color-accent, #ea5932)",
|
|
32
|
+
bgColor = "var(--sl-color-bg-nav, #f8f9fa)",
|
|
33
|
+
borderColor = "var(--sl-color-hairline, #e5e7eb)",
|
|
34
|
+
...rest
|
|
35
|
+
} = Astro.props;
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
<BaseAllContributors focusColor={focusColor} bgColor={bgColor} borderColor={borderColor} {...rest} />
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
---
|
|
2
|
+
// SPDX-FileCopyrightText: 2026 Knitli Inc.
|
|
3
|
+
// SPDX-FileContributor: Adam Poulemanos <adam@knit.li>
|
|
4
|
+
//
|
|
5
|
+
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
6
|
+
//
|
|
7
|
+
// Knitli-branded wrapper around astro-contributors ContributorList.
|
|
8
|
+
// Pre-applies brand colors while allowing per-instance overrides.
|
|
9
|
+
//
|
|
10
|
+
// Usage:
|
|
11
|
+
// <Contributors githubRepo="knitli/recoco" />
|
|
12
|
+
|
|
13
|
+
import { ContributorList } from "astro-contributors";
|
|
14
|
+
|
|
15
|
+
export interface Props {
|
|
16
|
+
/** GitHub repo in "owner/repo" format */
|
|
17
|
+
githubRepo?: `${string}/${string}`;
|
|
18
|
+
/** Usernames to exclude from the list */
|
|
19
|
+
ignore?: string[];
|
|
20
|
+
/** Focus/accent color for hover states. Defaults to Knitli rust. */
|
|
21
|
+
focusColor?: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
const {
|
|
25
|
+
focusColor = "var(--sl-color-accent, #ea5932)",
|
|
26
|
+
...rest
|
|
27
|
+
} = Astro.props;
|
|
28
|
+
---
|
|
29
|
+
|
|
30
|
+
<ContributorList focusColor={focusColor} {...rest} />
|
|
@@ -5,7 +5,8 @@
|
|
|
5
5
|
// SPDX-License-Identifier: MIT OR Apache-2.0
|
|
6
6
|
|
|
7
7
|
interface Props {
|
|
8
|
-
|
|
8
|
+
/** Product name — validated against the product catalog */
|
|
9
|
+
product?: string;
|
|
9
10
|
productUrl?: string;
|
|
10
11
|
path?: string;
|
|
11
12
|
/** 'inline' — no padding, designed for embedding in a subnav bar */
|
|
@@ -20,14 +20,11 @@ import Pagination from "virtual:starlight/components/Pagination";
|
|
|
20
20
|
// @ts-expect-error
|
|
21
21
|
import config from "virtual:starlight/user-config";
|
|
22
22
|
import { Icon } from "@astrojs/starlight/components";
|
|
23
|
+
import { products } from "../data/products.js";
|
|
23
24
|
|
|
24
25
|
const currentYear = new Date().getFullYear();
|
|
25
26
|
|
|
26
|
-
const product = (import.meta.env.PUBLIC_DOCS_PRODUCT ?? "") as
|
|
27
|
-
| "Recoco"
|
|
28
|
-
| "CodeWeaver"
|
|
29
|
-
| "Thread"
|
|
30
|
-
| "";
|
|
27
|
+
const product = (import.meta.env.PUBLIC_DOCS_PRODUCT ?? "") as string;
|
|
31
28
|
|
|
32
29
|
const shouldShowDocsHomeLink = Astro.url.pathname !== "/";
|
|
33
30
|
---
|
|
@@ -109,33 +106,26 @@ const shouldShowDocsHomeLink = Astro.url.pathname !== "/";
|
|
|
109
106
|
<p class="nav-heading">Docs</p>
|
|
110
107
|
<ul>
|
|
111
108
|
{shouldShowDocsHomeLink && <li><a href="https://docs.knitli.com">Developer Docs</a></li>}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
)
|
|
116
|
-
<
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
target="_blank"
|
|
133
|
-
rel="noopener noreferrer"
|
|
134
|
-
>
|
|
135
|
-
Thread ↗
|
|
136
|
-
</a>
|
|
137
|
-
)}
|
|
138
|
-
</li>
|
|
109
|
+
{products
|
|
110
|
+
.filter((p) => p.docsUrl)
|
|
111
|
+
.sort((a, b) => a.order - b.order)
|
|
112
|
+
.map((p) => (
|
|
113
|
+
<li key={p.name}>
|
|
114
|
+
{product === p.name ? (
|
|
115
|
+
<span class="link-current">{p.name}</span>
|
|
116
|
+
) : p.external ? (
|
|
117
|
+
<a
|
|
118
|
+
href={p.docsUrl}
|
|
119
|
+
target="_blank"
|
|
120
|
+
rel="noopener noreferrer"
|
|
121
|
+
>
|
|
122
|
+
{p.name} ↗
|
|
123
|
+
</a>
|
|
124
|
+
) : (
|
|
125
|
+
<a href={`https://docs.knitli.com/${p.slug}/`}>{p.name}</a>
|
|
126
|
+
)}
|
|
127
|
+
</li>
|
|
128
|
+
))}
|
|
139
129
|
</ul>
|
|
140
130
|
</nav>
|
|
141
131
|
</div>
|
|
@@ -20,11 +20,7 @@ import DocsBreadcrumb from "./DocsBreadcrumb.astro";
|
|
|
20
20
|
|
|
21
21
|
const { hasSidebar } = Astro.locals.starlightRoute;
|
|
22
22
|
|
|
23
|
-
const product = import.meta.env.PUBLIC_DOCS_PRODUCT as
|
|
24
|
-
| "Recoco"
|
|
25
|
-
| "CodeWeaver"
|
|
26
|
-
| "Thread"
|
|
27
|
-
| undefined;
|
|
23
|
+
const product = import.meta.env.PUBLIC_DOCS_PRODUCT as string | undefined;
|
|
28
24
|
|
|
29
25
|
// Strip the configured base URL to get the within-product path for the breadcrumb.
|
|
30
26
|
// e.g. for base='/Recoco/' and pathname='/Recoco/guide/start', path = 'guide/start'
|