@jaamd/jaad 0.11.0 → 1.0.0-rc.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.
Files changed (138) hide show
  1. package/README.md +8 -2
  2. package/dist/jaad.css +232 -347
  3. package/docs/00-overview.md +25 -0
  4. package/docs/01-getting-started/01-installation.md +216 -0
  5. package/docs/01-getting-started/02-pages.md +109 -0
  6. package/docs/01-getting-started/03-deployment.md +100 -0
  7. package/docs/02-configurations/01-reference.md +215 -0
  8. package/docs/02-configurations/02-frontmatter.md +105 -0
  9. package/docs/02-configurations/03-i18n.md +210 -0
  10. package/docs/02-configurations/04-search.md +58 -0
  11. package/docs/02-configurations/05-themes.md +104 -0
  12. package/docs/02-configurations/06-styles.md +156 -0
  13. package/docs/02-configurations/07-custom-pages.md +119 -0
  14. package/docs/02-configurations/08-advanced-layout.md +139 -0
  15. package/docs/03-upgrading.md +208 -0
  16. package/index.ts +8 -22
  17. package/package.json +10 -9
  18. package/site.ts +18 -1
  19. package/src/config.ts +25 -176
  20. package/src/{advanced.ts → docs/advanced.ts} +6 -4
  21. package/src/docs/collection.ts +109 -0
  22. package/src/docs/components/Breadcrumbs.astro +29 -0
  23. package/src/docs/components/DocsMobileNav.astro +90 -0
  24. package/src/docs/components/DocsNavTree.astro +57 -0
  25. package/src/docs/components/DocsPage.astro +66 -0
  26. package/src/{components/docs → docs/components}/DocsPageNav.astro +4 -4
  27. package/src/docs/components/DocsSidebarLeft.astro +53 -0
  28. package/src/{components/docs → docs/components}/PageActions.astro +10 -8
  29. package/src/{components/docs → docs/components}/StructuredData.astro +3 -3
  30. package/src/{components/docs → docs/components}/TableOfContents.astro +20 -22
  31. package/src/docs/config.ts +167 -0
  32. package/src/docs/content.ts +36 -0
  33. package/src/docs/endpoints.ts +89 -0
  34. package/src/docs/integration.ts +249 -0
  35. package/src/{layouts → docs/layouts}/DefaultDocsFrame.astro +7 -5
  36. package/src/{layouts → docs/layouts}/Docs.astro +44 -43
  37. package/src/docs/layouts/Page.astro +18 -0
  38. package/src/docs/link-plugins.ts +52 -0
  39. package/src/docs/links.ts +42 -0
  40. package/src/{locale-tree.ts → docs/locale-tree.ts} +1 -1
  41. package/src/docs/model/ids.ts +87 -0
  42. package/src/docs/model/rendered.ts +185 -0
  43. package/src/docs/model/tree.ts +124 -0
  44. package/src/docs/model/validate.ts +75 -0
  45. package/src/docs/navigation.ts +75 -0
  46. package/src/{routes → docs/routes}/404.astro +1 -1
  47. package/src/docs/routes/docs-index.astro +19 -0
  48. package/src/docs/routes/docs-slug.astro +54 -0
  49. package/src/{routes → docs/routes}/docs-slug.md.ts +8 -10
  50. package/src/{routes → docs/routes}/llms-locale.txt.ts +1 -1
  51. package/src/{routes → docs/routes}/llms.txt.ts +1 -1
  52. package/src/{routes → docs/routes}/search-index-locale.json.ts +1 -1
  53. package/src/{routes → docs/routes}/search-index.json.ts +1 -1
  54. package/src/docs/runtime.ts +17 -0
  55. package/src/docs/search-index.ts +39 -0
  56. package/src/docs/styles/components/breadcrumbs.css +26 -0
  57. package/src/docs/styles/components/docs-mobile-nav.css +47 -0
  58. package/src/docs/styles/components/docs-page-nav.css +41 -0
  59. package/src/docs/styles/components/docs-sidebar.css +59 -0
  60. package/src/docs/styles/components/page-actions.css +51 -0
  61. package/src/docs/styles/components/toc.css +38 -0
  62. package/src/docs/styles/components.css +7 -0
  63. package/src/docs/styles/docs.css +81 -0
  64. package/src/{@types/docs.ts → docs/types.ts} +8 -16
  65. package/src/{urls.ts → docs/urls.ts} +2 -16
  66. package/src/env.d.ts +1 -1
  67. package/src/integration.ts +15 -249
  68. package/src/{components → site/components}/Footer.astro +1 -1
  69. package/src/{components → site/components}/Header.astro +14 -11
  70. package/src/{components → site/components}/LocaleSwitcher.astro +2 -2
  71. package/src/{components → site/components}/NavMobile.astro +1 -1
  72. package/src/{components → site/components}/SearchPalette.astro +160 -79
  73. package/src/{components → site/components}/ThemeSwitcher.astro +1 -1
  74. package/src/site/config.ts +149 -0
  75. package/src/{infer.ts → site/infer.ts} +3 -3
  76. package/src/site/integration.ts +59 -0
  77. package/src/{layouts/Page.astro → site/layouts/Shell.astro} +6 -3
  78. package/src/{locales.ts → site/locales.ts} +9 -1
  79. package/src/{docs-config.ts → site/runtime.ts} +1 -12
  80. package/src/site/search.ts +227 -0
  81. package/src/{social.ts → site/social.ts} +2 -2
  82. package/src/site/styles/components/header.css +31 -0
  83. package/src/{styles → site/styles}/components/search.css +21 -1
  84. package/src/{styles → site/styles}/components/shell.css +4 -0
  85. package/src/site/styles/components.css +10 -0
  86. package/src/{styles → site/styles}/global.css +4 -26
  87. package/src/{themes/index.ts → site/themes.ts} +1 -1
  88. package/src/{ui → site/ui}/en.ts +3 -5
  89. package/src/{ui → site/ui}/it.ts +2 -4
  90. package/src/site/urls.ts +14 -0
  91. package/src/{virtual.ts → site/virtual.ts} +12 -18
  92. package/src/styles.css +5 -0
  93. package/src/collection.ts +0 -97
  94. package/src/components/ScrollToTop.astro +0 -43
  95. package/src/components/docs/Breadcrumbs.astro +0 -36
  96. package/src/components/docs/DocsMobileNav.astro +0 -93
  97. package/src/components/docs/DocsPage.astro +0 -68
  98. package/src/components/docs/DocsSidebarLeft.astro +0 -82
  99. package/src/content.ts +0 -42
  100. package/src/navigation.ts +0 -97
  101. package/src/routes/docs-index.astro +0 -19
  102. package/src/routes/docs-slug.astro +0 -58
  103. package/src/styles/components/breadcrumbs.css +0 -13
  104. package/src/styles/components/docs-mobile-nav.css +0 -9
  105. package/src/styles/components/docs-page-nav.css +0 -31
  106. package/src/styles/components/docs-sidebar.css +0 -42
  107. package/src/styles/components/header.css +0 -20
  108. package/src/styles/components/page-actions.css +0 -13
  109. package/src/styles/components/scroll-to-top.css +0 -11
  110. package/src/styles/components/toc.css +0 -21
  111. package/src/styles/docs.css +0 -112
  112. package/src/utils/docs.ts +0 -300
  113. package/src/utils/endpoints.ts +0 -80
  114. package/src/utils/search.ts +0 -83
  115. /package/src/{styles → docs/styles}/components/docs-page.css +0 -0
  116. /package/src/{styles → docs/styles}/jaamd.css +0 -0
  117. /package/src/{components → site/components}/Head.astro +0 -0
  118. /package/src/{components → site/components}/Nav.astro +0 -0
  119. /package/src/{components → site/components}/SocialLinks.astro +0 -0
  120. /package/src/{components → site/components}/locale-switcher.ts +0 -0
  121. /package/src/{fonts → site/fonts}/OFL.txt +0 -0
  122. /package/src/{fonts → site/fonts}/inter.woff2 +0 -0
  123. /package/src/{fonts → site/fonts}/merriweather-italic.woff2 +0 -0
  124. /package/src/{fonts → site/fonts}/merriweather.woff2 +0 -0
  125. /package/src/{fonts.ts → site/fonts.ts} +0 -0
  126. /package/src/{forges.ts → site/forges.ts} +0 -0
  127. /package/src/{utils → site}/helpers.ts +0 -0
  128. /package/src/{styles → site/styles}/components/footer.css +0 -0
  129. /package/src/{styles → site/styles}/components/locale-switcher.css +0 -0
  130. /package/src/{styles → site/styles}/components/nav-mobile.css +0 -0
  131. /package/src/{styles → site/styles}/components/nav.css +0 -0
  132. /package/src/{styles → site/styles}/components/not-found.css +0 -0
  133. /package/src/{styles → site/styles}/components/social-links.css +0 -0
  134. /package/src/{styles → site/styles}/components/theme-switcher.css +0 -0
  135. /package/src/{styles → site/styles}/jaamd-forward.css +0 -0
  136. /package/src/{styles → site/styles}/jaamd-reverse.css +0 -0
  137. /package/src/{styles → site/styles}/tailwind.css +0 -0
  138. /package/src/{ui.ts → site/ui.ts} +0 -0
@@ -0,0 +1,25 @@
1
+ ---
2
+ description: JAAD turns a folder of Markdown files into a documentation site.
3
+ ---
4
+
5
+ # Overview
6
+
7
+ **Just Another Astro Docs**: JAAD is an Astro integration that turns a folder
8
+ of Markdown files into a documentation site. The folder is the configuration:
9
+ there is no sidebar to declare and no route to write.
10
+
11
+ - **Navigation** from the file tree: sidebar, chapters, previous
12
+ and next links. See [Pages and structure](01-getting-started/02-pages.md).
13
+ - **Search** across every page, built at compile time, with no external
14
+ service. See [Search](02-configurations/04-search.md).
15
+ - **Languages**, one site per locale directory, with a switcher and `hreflang`.
16
+ See [Languages](02-configurations/03-i18n.md).
17
+ - **Themes** for the interface and the code, light and dark. See
18
+ [Themes](02-configurations/05-themes.md).
19
+ - **Metadata** for search engines and social cards, a sitemap, raw Markdown
20
+ routes and an `llms.txt` for language models.
21
+
22
+ Pages are rendered with [JAAMD](../../astro/docs/00-overview.md), so its
23
+ Markdown syntax and enhancements come with them.
24
+
25
+ Start with [Installation](01-getting-started/01-installation.md).
@@ -0,0 +1,216 @@
1
+ ---
2
+ description: Create a JAAD project, or add JAAD to an existing repository or Astro project.
3
+ ---
4
+
5
+ # Installation
6
+
7
+ `create-jaad` sets up a project in one command. To add JAAD by hand, see
8
+ [Manual installation](#manual-installation).
9
+
10
+ ## Create a project
11
+
12
+ :::code-tabs
13
+
14
+ ```bash npm
15
+ npm create @jaamd/jaad@latest
16
+ ```
17
+
18
+ ```bash pnpm
19
+ pnpm create @jaamd/jaad@latest
20
+ ```
21
+
22
+ ```bash yarn
23
+ yarn create @jaamd/jaad@latest
24
+ ```
25
+
26
+ ```bash bun
27
+ bun create @jaamd/jaad@latest
28
+ ```
29
+
30
+ :::
31
+
32
+ The CLI asks for a destination, template, title and whether to install
33
+ dependencies. The `docs` template puts documentation at `/` and is the default;
34
+ `site` adds a landing page at `/` and moves documentation to `/docs`.
35
+
36
+ To provide every answer as flags:
37
+
38
+ :::code-tabs
39
+
40
+ ```bash npm
41
+ npm create @jaamd/jaad@latest my-docs -- --title "My Docs" --install
42
+ ```
43
+
44
+ ```bash pnpm
45
+ pnpm create @jaamd/jaad@latest my-docs --title "My Docs" --install
46
+ ```
47
+
48
+ ```bash yarn
49
+ yarn create @jaamd/jaad@latest my-docs --title "My Docs" --install
50
+ ```
51
+
52
+ ```bash bun
53
+ bun create @jaamd/jaad@latest my-docs --title "My Docs" --install
54
+ ```
55
+
56
+ :::
57
+
58
+ Use `--here` inside an existing repository:
59
+
60
+ :::code-tabs
61
+
62
+ ```bash npm
63
+ npm create @jaamd/jaad@latest -- --here
64
+ ```
65
+
66
+ ```bash pnpm
67
+ pnpm create @jaamd/jaad@latest --here
68
+ ```
69
+
70
+ ```bash yarn
71
+ yarn create @jaamd/jaad@latest --here
72
+ ```
73
+
74
+ ```bash bun
75
+ bun create @jaamd/jaad@latest --here
76
+ ```
77
+
78
+ :::
79
+
80
+ The command keeps the existing `package.json` and Markdown files. It stops
81
+ without writing when a custom Astro or Content configuration requires a manual
82
+ merge, and when `--template site` meets a `jaad.config.*` it did not write:
83
+ the landing page needs `routeBase: "/docs"`, which only you can set.
84
+
85
+ > [!NOTE]
86
+ > Non-interactive environments require a destination or `--here`, `--title`,
87
+ > and either `--install` or `--no-install`.
88
+
89
+ ## Run locally
90
+
91
+ :::code-tabs
92
+
93
+ ```bash npm
94
+ npm run dev
95
+ ```
96
+
97
+ ```bash pnpm
98
+ pnpm dev
99
+ ```
100
+
101
+ ```bash yarn
102
+ yarn dev
103
+ ```
104
+
105
+ ```bash bun
106
+ bun run dev
107
+ ```
108
+
109
+ :::
110
+
111
+ The development server starts at `http://localhost:4321`.
112
+
113
+ Add pages to `docs/`, following the conventions in
114
+ [Pages and structure](02-pages.md).
115
+
116
+ ## Manual installation
117
+
118
+ Install JAAD in a project on Astro 7.3 or a later 7.x, with Node.js 22.12 or later:
119
+
120
+ :::code-tabs
121
+
122
+ ```bash npm
123
+ npm install @jaamd/jaad
124
+ ```
125
+
126
+ ```bash pnpm
127
+ pnpm add @jaamd/jaad
128
+ ```
129
+
130
+ ```bash yarn
131
+ yarn add @jaamd/jaad
132
+ ```
133
+
134
+ ```bash bun
135
+ bun add @jaamd/jaad
136
+ ```
137
+
138
+ :::
139
+
140
+ Add the following files:
141
+
142
+ ```ts
143
+ // jaad.config.ts
144
+ import { defineJaadConfig } from '@jaamd/jaad'
145
+
146
+ export default defineJaadConfig({
147
+ site: 'https://example.dev',
148
+ title: 'My Project',
149
+ })
150
+ ```
151
+
152
+ ```js
153
+ // astro.config.mjs
154
+ export { default } from '@jaamd/jaad/site'
155
+ ```
156
+
157
+ ```ts
158
+ // src/content.config.ts
159
+ export { collections } from '@jaamd/jaad/content'
160
+ ```
161
+
162
+ ```json
163
+ // tsconfig.json
164
+ {
165
+ "extends": "astro/tsconfigs/strict"
166
+ }
167
+ ```
168
+
169
+ Only `title` is required. See the
170
+ [configuration reference](../02-configurations/01-reference.md) for the remaining
171
+ options.
172
+
173
+ ## Existing Astro project
174
+
175
+ If `--here` reports custom `astro.config.*` or `src/content.config.*` files,
176
+ keep their existing configuration and merge JAAD manually.
177
+
178
+ Add the integration to the Astro configuration:
179
+
180
+ ```ts
181
+ import jaad from '@jaamd/jaad'
182
+ // astro.config.ts
183
+ import { defineConfig } from 'astro/config'
184
+ import jaadConfig from './jaad.config'
185
+
186
+ export default defineConfig({
187
+ site: jaadConfig.site,
188
+ base: jaadConfig.base,
189
+ integrations: [jaad(jaadConfig)],
190
+ })
191
+ ```
192
+
193
+ `jaad()` returns integrations only. `site` and `base` are lifted above, and the
194
+ [`astro`](../02-configurations/01-reference.md#extending-astro) field is ignored here.
195
+ Write those options in `defineConfig`.
196
+
197
+ If the project defines content collections, add JAAD's collection without
198
+ replacing them:
199
+
200
+ ```ts
201
+ import { collections as jaadCollections } from '@jaamd/jaad/content'
202
+ // src/content.config.ts
203
+ import { defineCollection } from 'astro:content'
204
+
205
+ const blog = defineCollection({/* existing loader and schema */})
206
+
207
+ export const collections = {
208
+ blog,
209
+ ...jaadCollections,
210
+ }
211
+ ```
212
+
213
+ The collection name `docsPages` is reserved for JAAD.
214
+
215
+ Create `docs/`, add a Markdown page, then run the project with its existing
216
+ development script.
@@ -0,0 +1,109 @@
1
+ ---
2
+ description: How the files in docs/ become pages, chapters, sections and URLs.
3
+ ---
4
+
5
+ # Pages and structure
6
+
7
+ Every Markdown file in `docs/` is a page. Its place in the folder sets its URL
8
+ and its place in the navigation; nothing else needs configuring.
9
+
10
+ ```
11
+ docs/
12
+ 01-introduction.md → /
13
+ 02-guides/ → sidebar chapter "Guides"
14
+ 01-setup.md → /guides/setup
15
+ 02-deployment.md → /guides/deployment
16
+ 03-reference.md → /reference
17
+ ```
18
+
19
+ The same tree builds the sidebar, the mobile menu, the line above each title and the
20
+ previous and next links.
21
+
22
+ ## Rules
23
+
24
+ - A numeric prefix sets the order and is removed from the URL. Files without
25
+ one sort after the numbered files.
26
+ - A folder becomes a chapter. Only one folder level is supported.
27
+ - The first `# Heading` is the page title.
28
+ - The `##` and `###` headings make the page's table of contents. Wrap headings
29
+ in `<div data-toc-ignore>` to leave them out.
30
+ - Removing the prefixes must leave every page and chapter with a unique path.
31
+
32
+ Invalid nesting and duplicate paths stop the build and name the conflicting
33
+ files.
34
+
35
+ ## The opening page
36
+
37
+ The file that sorts first opens the documentation at `routeBase`, which is `/`
38
+ by default. Its browser title is the site name alone, and its own slug
39
+ redirects to it: with `routeBase: "/docs"`, `01-introduction.md` opens at
40
+ `/docs`, and `/docs/introduction` redirects there.
41
+
42
+ ## Linking between pages
43
+
44
+ Link to another page by its file, relative to the one you are writing:
45
+
46
+ ```markdown
47
+ See [Deployment](./02-guides/02-deployment.md#hosting).
48
+ ```
49
+
50
+ JAAD turns the link into the page's URL, so it also works on GitHub and in an
51
+ editor. A link to a file that does not exist stops the build.
52
+
53
+ ## Sections
54
+
55
+ A larger site can split its documentation into sections, each with its own
56
+ directory, chapters and sidebar group:
57
+
58
+ ```ts
59
+ defineJaadConfig({
60
+ title: 'My Project',
61
+ sections: {
62
+ guide: { dir: './docs/guide', label: 'Guide' },
63
+ api: { dir: '../packages/api/docs' },
64
+ },
65
+ })
66
+ ```
67
+
68
+ - The key is the URL segment: `api/01-client.md` is served at `/api/client`.
69
+ - `label` names the section, in the sidebar and in the browser title of its
70
+ pages; it defaults to the key.
71
+ - A directory can sit outside the project, such as the `docs/` of a package. No
72
+ section's directory can be inside another's.
73
+ - Sections appear in the order they are declared. `docsDir` is read alongside
74
+ them only when you set it: its pages sit outside every section, come first,
75
+ and the first of them opens the docs. Its directory cannot hold a section's.
76
+ - Previous and next links run on from one section into the next.
77
+ - The first page of the first section opens at `routeBase`; the first page of
78
+ every other section opens at the section's own URL.
79
+ - The rules above apply inside each section.
80
+
81
+ This documentation is built that way: one section for JAAMD and one for JAAD,
82
+ each read from its package.
83
+
84
+ ## Overriding the file tree
85
+
86
+ [Frontmatter](../02-configurations/02-frontmatter.md) renames a page, moves it
87
+ without renaming the file, or keeps it out of the build:
88
+
89
+ ```markdown
90
+ ---
91
+ title: Images & Videos
92
+ label: Media
93
+ order: 5
94
+ draft: true
95
+ ---
96
+ ```
97
+
98
+ ## More than one language
99
+
100
+ Directories named after language codes turn the tree into one site per
101
+ language, and the rules above then apply inside each of them. With sections,
102
+ every section holds the same language directories. See
103
+ [Languages](../02-configurations/03-i18n.md).
104
+
105
+ ## Markdown
106
+
107
+ Pages are rendered with [JAAMD](../../../astro/docs/00-overview.md): alerts,
108
+ code tabs, tables of contents and spoilers are written as described in
109
+ [Markdown syntax](../../../astro/docs/02-markdown.md).
@@ -0,0 +1,100 @@
1
+ ---
2
+ description: Build JAAD as a static site and publish it on GitHub Pages or any static host.
3
+ ---
4
+
5
+ # Deployment
6
+
7
+ JAAD builds a static site in `dist/`:
8
+
9
+ :::code-tabs
10
+
11
+ ```bash npm
12
+ npm run build
13
+ npm run preview
14
+ ```
15
+
16
+ ```bash pnpm
17
+ pnpm build
18
+ pnpm preview
19
+ ```
20
+
21
+ ```bash yarn
22
+ yarn build
23
+ yarn preview
24
+ ```
25
+
26
+ ```bash bun
27
+ bun run build
28
+ bun run preview
29
+ ```
30
+
31
+ :::
32
+
33
+ Set `site` to the public URL so JAAD can generate canonical links, the sitemap
34
+ and social image URLs. Add `base` when the site is served from a subpath.
35
+
36
+ ```ts
37
+ export default defineJaadConfig({
38
+ site: 'https://me.github.io',
39
+ base: '/my-repo',
40
+ title: 'My Project',
41
+ })
42
+ ```
43
+
44
+ ## GitHub Pages
45
+
46
+ Select **GitHub Actions** as the Pages source, then add:
47
+
48
+ ```yaml
49
+ # .github/workflows/deploy.yml
50
+ name: Deploy
51
+
52
+ on:
53
+ push:
54
+ branches: [main]
55
+ workflow_dispatch:
56
+
57
+ permissions:
58
+ contents: read
59
+ pages: write
60
+ id-token: write
61
+
62
+ concurrency:
63
+ group: pages
64
+ cancel-in-progress: false
65
+
66
+ jobs:
67
+ build:
68
+ runs-on: ubuntu-latest
69
+ steps:
70
+ - uses: actions/checkout@v7
71
+ - uses: withastro/action@v6
72
+ # with:
73
+ # path: . # the Astro project, if not the root
74
+ # node-version: 24
75
+ # package-manager: npm@latest
76
+
77
+ deploy:
78
+ needs: build
79
+ runs-on: ubuntu-latest
80
+ environment:
81
+ name: github-pages
82
+ url: ${{ steps.deployment.outputs.page_url }}
83
+ steps:
84
+ - id: deployment
85
+ uses: actions/deploy-pages@v5
86
+ ```
87
+
88
+ ## Other hosts
89
+
90
+ For [Netlify](https://docs.astro.build/en/guides/integrations-guide/netlify/), [Vercel](https://docs.astro.build/en/guides/integrations-guide/vercel/), [Cloudflare Pages](https://docs.astro.build/en/guides/integrations-guide/cloudflare/) or another static host, use
91
+ `npm run build` as the build command and `dist` as the publish directory.
92
+
93
+ ## Generated files
94
+
95
+ In addition to the pages, the build writes:
96
+
97
+ - `sitemap-index.xml` when `site` is set;
98
+ - `<routeBase>/search-index.json` for search;
99
+ - `<routeBase>/llms.txt` as a plain-text page index;
100
+ - `<routeBase>/**.md` for raw Markdown routes.
@@ -0,0 +1,215 @@
1
+ ---
2
+ description: Every option of jaad.config.ts, and the values JAAD detects from the project.
3
+ ---
4
+
5
+ # Configuration
6
+
7
+ All JAAD options live in `jaad.config.ts`. Only `title` is required.
8
+
9
+ ```ts
10
+ import { defineJaadConfig } from '@jaamd/jaad'
11
+
12
+ export default defineJaadConfig({
13
+ site: 'https://example.dev',
14
+ title: 'My Project',
15
+ })
16
+ ```
17
+
18
+ These options apply only to documentation pages. Pages in `src/pages/` keep
19
+ their own layout, styles and metadata.
20
+
21
+ ## Site
22
+
23
+ | Option | Type | Default | Description |
24
+ | ------ | -------- | ------- | --------------------------------------------------- |
25
+ | `site` | `string` | none | Public URL used for canonical links and the sitemap |
26
+ | `base` | `string` | none | Subpath when the site is not served from `/` |
27
+
28
+ ## Identity
29
+
30
+ | Option | Type | Default | Description |
31
+ | ------------- | -------- | -------------- | ------------------------------------------------- |
32
+ | `title` | `string` | none | **Required.** Site name and metadata |
33
+ | `description` | `string` | `package.json` | Site description |
34
+ | `lang` | `string` | `"en"` | Site language, and the default when localised |
35
+ | `logo` | `string` | none | Public path or URL shown instead of the site name |
36
+ | `homeLink` | `string` | `"/"` | Where the site name in the header leads |
37
+
38
+ A source file path passed to `logo` produces a build error. Use a public path
39
+ such as `/logo.svg`.
40
+
41
+ When the documentation is part of a larger site, point `homeLink` at that
42
+ site's home: `homeLink: "https://example.dev"`. A path such as `/` gets
43
+ Astro's `base`.
44
+
45
+ ## Content
46
+
47
+ | Option | Type | Default | Description |
48
+ | ----------- | ------------------- | ---------- | ----------------------------------------- |
49
+ | `docsDir` | `string` | `"./docs"` | Directory containing Markdown files |
50
+ | `routeBase` | `string` | `"/"` | Route where documentation is mounted |
51
+ | `sections` | `object` | none | One directory per section, by URL segment |
52
+ | `locales` | `string[] \| false` | detected | Override the detected locale directories |
53
+ | `ui` | `object` | `{}` | Interface string overrides, per locale |
54
+
55
+ Locale directories under `docsDir` are detected on their own; `locales` only
56
+ overrides that. See [Languages](03-i18n.md).
57
+
58
+ With `sections`, `docsDir` is read only when set, for pages outside every
59
+ section. See [Sections](../01-getting-started/02-pages.md#sections).
60
+
61
+ To keep a landing page at `/`, mount documentation below it:
62
+
63
+ ```ts
64
+ defineJaadConfig({ title: 'My Project', routeBase: '/docs' })
65
+ ```
66
+
67
+ When documentation is mounted at `/`, an existing `src/pages/index.*` creates
68
+ a route conflict and JAAD reports the required `routeBase` setting.
69
+
70
+ ## Navigation
71
+
72
+ | Option | Type | Default | Description |
73
+ | -------- | ----------------------------------- | -------- | ----------------- |
74
+ | `nav` | `{ label: string; href: string }[]` | `[]` | Header text links |
75
+ | `social` | `Record<string, string \| object>` | inferred | Header icon links |
76
+
77
+ For example:
78
+
79
+ ```ts
80
+ defineJaadConfig({
81
+ title: 'My Project',
82
+ nav: [{ label: 'API', href: 'https://api.example.dev' }],
83
+ social: {
84
+ github: 'https://github.com/me/repo',
85
+ forum: {
86
+ href: 'https://forum.example.dev',
87
+ label: 'Forum',
88
+ svg: `<svg viewBox="0 0 24 24">...</svg>`,
89
+ },
90
+ },
91
+ })
92
+ ```
93
+
94
+ Bundled forge icons are available for `github`, `gitlab`, `codeberg`, `gitea`,
95
+ `forgejo`, `bitbucket` and `sourcehut`. Other keys require an `svg`.
96
+
97
+ Object entries accept `href`, with optional `label` and `svg` fields.
98
+
99
+ When `social` is omitted, JAAD derives the repository link and forge icon from
100
+ the git remote. An explicit forge entry overrides that inference.
101
+
102
+ ## Footer
103
+
104
+ | Option | Type | Default | Description |
105
+ | -------- | ----------------- | --------- | ------------------------------------ |
106
+ | `footer` | `string \| false` | `:credit` | Footer HTML, or `false` to remove it |
107
+
108
+ Use `:credit` to place the JAAD credit inside custom text:
109
+
110
+ ```ts
111
+ defineJaadConfig({ title: '...', footer: '© 2026 Me · :credit' })
112
+ ```
113
+
114
+ ## Repository
115
+
116
+ | Option | Type | Default | Description |
117
+ | ---------- | ------------------- | ------- | ----------------------------------------------- |
118
+ | `editLink` | `boolean \| string` | `true` | Derive, override or hide “Edit this page” links |
119
+
120
+ Pass a URL to override the inferred repository. `:path` is replaced with the
121
+ source file path, or appended when absent:
122
+
123
+ ```ts
124
+ defineJaadConfig({
125
+ title: '...',
126
+ editLink: 'https://git.example.dev/me/repo/edit/main/docs/:path',
127
+ })
128
+ ```
129
+
130
+ The link is omitted when the git remote, branch or repository root cannot be
131
+ resolved safely.
132
+
133
+ With [sections](../01-getting-started/02-pages.md#sections), each one links
134
+ to its own directory. A URL passed here applies to all of them, and `:path` is
135
+ the file's path inside its section's directory.
136
+
137
+ ## SEO and head tags
138
+
139
+ | Option | Type | Default | Description |
140
+ | --------- | ----------------- | ---------------- | --------------------------------- |
141
+ | `head` | `object[]` | `[]` | Extra elements in `<head>` |
142
+ | `ogImage` | `string \| false` | detected or none | Social image path, URL or `false` |
143
+
144
+ JAAD detects `public/og-image.png`, `.jpg`, `.jpeg` or `.webp`, in that order.
145
+ Local images and canonical URLs require `site`; absolute image URLs do not.
146
+
147
+ Each `head` entry accepts `tag`, optional `attrs`, and optional `content`. Use
148
+ it for analytics, verification tags and preconnects:
149
+
150
+ ```ts
151
+ defineJaadConfig({
152
+ title: '...',
153
+ head: [
154
+ { tag: 'meta', attrs: { name: 'robots', content: 'index,follow' } },
155
+ { tag: 'script', attrs: { src: '/analytics.js', defer: true } },
156
+ ],
157
+ })
158
+ ```
159
+
160
+ ## Theme and appearance
161
+
162
+ | Option | Type | Default |
163
+ | ------------ | ------------------------------------------- | ----------- |
164
+ | `theme` | `string \| { light: string; dark: string }` | `"default"` |
165
+ | `appearance` | `"auto" \| "light" \| "dark"` | `"auto"` |
166
+ | `tailwind` | `boolean` | `false` |
167
+
168
+ A named theme styles the interface, Markdown and code blocks. A `{ light,
169
+ dark }` object changes only the Shiki code themes. See
170
+ [Themes](05-themes.md) for available names and custom themes.
171
+
172
+ `tailwind: true` enables Tailwind utilities with JAAD's tokens on documentation
173
+ pages, `Page` pages and a custom `DocsFrame`; see
174
+ [Styles](06-styles.md#tailwind).
175
+
176
+ `appearance: "auto"` follows the reader's preference and shows the switcher.
177
+ `"light"` and `"dark"` pin the appearance and remove it.
178
+
179
+ ## Detected project values
180
+
181
+ | Value | Source |
182
+ | ----------------------------------------- | ------------------------------------------------- |
183
+ | Repository and edit links | git remote, branch and `docsDir` |
184
+ | Missing description | `package.json` |
185
+ | Favicon | `public/favicon.svg`, `.ico` or `.png` |
186
+ | Social image | `public/og-image.png`, `.jpg`, `.jpeg` or `.webp` |
187
+ | Custom styles | `src/jaad.css` |
188
+ | Locales | Directory names under `docsDir` |
189
+ | Sitemap | Generated when `site` is set |
190
+ | Search index, `llms.txt` and raw Markdown | Generated below `routeBase` |
191
+
192
+ ## Extending Astro
193
+
194
+ | Option | Type | Default |
195
+ | ------- | ----------------- | ------- |
196
+ | `astro` | `AstroUserConfig` | `{}` |
197
+
198
+ Pass additional Astro options through `astro`. Extra integrations are appended
199
+ to JAAD's integrations:
200
+
201
+ ```ts
202
+ defineJaadConfig({
203
+ title: 'My Project',
204
+ astro: {
205
+ build: { format: 'file' },
206
+ integrations: [mdx()],
207
+ },
208
+ })
209
+ ```
210
+
211
+ `astro` is read by `@jaamd/jaad/site`. `jaad(config)` ignores it.
212
+
213
+ For full control, use a regular Astro configuration and add `jaad(config)` to
214
+ its integrations, as shown in
215
+ [Existing Astro project](../01-getting-started/01-installation.md#existing-astro-project).