@farming-labs/astro-theme 0.2.49 → 0.2.52

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.
Files changed (2) hide show
  1. package/README.md +80 -0
  2. package/package.json +3 -3
package/README.md ADDED
@@ -0,0 +1,80 @@
1
+ # @farming-labs/astro-theme
2
+
3
+ The Astro-native UI layer and theme preset package for
4
+ [`@farming-labs/docs`](https://www.npmjs.com/package/@farming-labs/docs).
5
+
6
+ It renders the docs shell, page content, search dialog, AI chat, and theme controls. Content
7
+ loading and route handlers live in `@farming-labs/astro`.
8
+
9
+ ## Install
10
+
11
+ ```bash
12
+ npm install @farming-labs/docs @farming-labs/astro @farming-labs/astro-theme @farming-labs/theme
13
+ ```
14
+
15
+ The CLI can scaffold the complete Astro integration:
16
+
17
+ ```bash
18
+ npx @farming-labs/docs@latest init
19
+ ```
20
+
21
+ ## Configure the theme
22
+
23
+ ```ts
24
+ // src/lib/docs.config.ts
25
+ import { defineDocs } from "@farming-labs/docs";
26
+ import { fumadocs } from "@farming-labs/astro-theme";
27
+
28
+ export default defineDocs({
29
+ entry: "docs",
30
+ contentDir: "docs",
31
+ theme: fumadocs(),
32
+ nav: { title: "Docs", url: "/docs" },
33
+ });
34
+ ```
35
+
36
+ ## Render the docs UI
37
+
38
+ Astro components are exported from component subpaths:
39
+
40
+ ```astro
41
+ ---
42
+ import DocsLayout from "@farming-labs/astro-theme/src/components/DocsLayout.astro";
43
+ import DocsContent from "@farming-labs/astro-theme/src/components/DocsContent.astro";
44
+ import SearchDialog from "@farming-labs/astro-theme/src/components/SearchDialog.astro";
45
+ import "@farming-labs/theme/default/css";
46
+
47
+ import config from "../../lib/docs.config";
48
+ import { load } from "../../lib/docs.server";
49
+
50
+ const data = await load(Astro.url.pathname);
51
+ ---
52
+
53
+ <DocsLayout tree={data.tree} config={config}>
54
+ <DocsContent data={data} config={config} />
55
+ </DocsLayout>
56
+ <SearchDialog config={config} />
57
+ ```
58
+
59
+ The server-side `load()` function comes from `@farming-labs/astro/server`.
60
+
61
+ ## Themes and components
62
+
63
+ The package ships `DocsLayout`, `DocsContent`, `DocsPage`, `SearchDialog`, `FloatingAIChat`, and
64
+ `ThemeToggle` Astro components.
65
+
66
+ Preset subpaths are `fumadocs`, `pixel-border`, `darksharp`, `colorful`, `greentree`, `hardline`,
67
+ `concrete`, `command-grid`, and `ledger`. The `fumadocs` preset uses
68
+ `@farming-labs/theme/default/css`; the other presets use the matching
69
+ `@farming-labs/theme/<preset>/css` entrypoint.
70
+
71
+ ## Learn more
72
+
73
+ - [Documentation](https://docs.farming-labs.dev/docs)
74
+ - [Themes](https://docs.farming-labs.dev/docs/themes)
75
+ - [Astro example](https://github.com/farming-labs/docs/tree/main/examples/astro)
76
+ - [GitHub repository](https://github.com/farming-labs/docs)
77
+
78
+ ## License
79
+
80
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farming-labs/astro-theme",
3
- "version": "0.2.49",
3
+ "version": "0.2.52",
4
4
  "description": "Astro UI components for @farming-labs/docs — layout, sidebar, TOC, search, and theme toggle",
5
5
  "keywords": [
6
6
  "astro",
@@ -119,8 +119,8 @@
119
119
  },
120
120
  "dependencies": {
121
121
  "sugar-high": "^0.9.5",
122
- "@farming-labs/docs": "0.2.49",
123
- "@farming-labs/astro": "0.2.49"
122
+ "@farming-labs/docs": "0.2.52",
123
+ "@farming-labs/astro": "0.2.52"
124
124
  },
125
125
  "peerDependencies": {
126
126
  "astro": ">=4.0.0"