@dogsbay/format-astro 0.2.0-beta.15 → 0.2.0-beta.150

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 (67) hide show
  1. package/dist/api-markdown.d.ts +7 -0
  2. package/dist/api-markdown.js +49 -0
  3. package/dist/base-path.d.ts +93 -8
  4. package/dist/base-path.js +122 -9
  5. package/dist/blog.d.ts +133 -0
  6. package/dist/blog.js +325 -0
  7. package/dist/browser.d.ts +13 -0
  8. package/dist/browser.js +13 -0
  9. package/dist/canonical.d.ts +35 -0
  10. package/dist/canonical.js +110 -0
  11. package/dist/capabilities.d.ts +28 -0
  12. package/dist/capabilities.js +94 -0
  13. package/dist/cli.d.ts +0 -1
  14. package/dist/cli.js +3 -1
  15. package/dist/diff-decoration.d.ts +35 -0
  16. package/dist/diff-decoration.js +101 -0
  17. package/dist/granularity.d.ts +82 -0
  18. package/dist/granularity.js +246 -0
  19. package/dist/head-metadata.d.ts +25 -0
  20. package/dist/head-metadata.js +55 -0
  21. package/dist/index.d.ts +26 -6
  22. package/dist/index.js +34 -5
  23. package/dist/lead.d.ts +1 -39
  24. package/dist/lead.js +3 -38
  25. package/dist/llms-txt.d.ts +41 -11
  26. package/dist/llms-txt.js +82 -274
  27. package/dist/plugins.d.ts +0 -1
  28. package/dist/plugins.js +4 -3
  29. package/dist/project.d.ts +461 -13
  30. package/dist/project.js +2343 -649
  31. package/dist/redirects.d.ts +117 -0
  32. package/dist/redirects.js +223 -0
  33. package/dist/serialize.d.ts +14 -1
  34. package/dist/serialize.js +857 -255
  35. package/dist/site-chrome.d.ts +60 -0
  36. package/dist/site-chrome.js +56 -0
  37. package/dist/sitemap.d.ts +62 -4
  38. package/dist/sitemap.js +63 -56
  39. package/dist/taxonomy.d.ts +48 -2
  40. package/dist/taxonomy.js +50 -12
  41. package/dist/theme-css.d.ts +33 -0
  42. package/dist/theme-css.js +683 -0
  43. package/dist/tone-classes.d.ts +52 -0
  44. package/dist/tone-classes.js +84 -0
  45. package/dist/write-if-changed.d.ts +20 -0
  46. package/dist/write-if-changed.js +57 -0
  47. package/package.json +17 -7
  48. package/dist/base-path.d.ts.map +0 -1
  49. package/dist/base-path.js.map +0 -1
  50. package/dist/cli.d.ts.map +0 -1
  51. package/dist/cli.js.map +0 -1
  52. package/dist/index.d.ts.map +0 -1
  53. package/dist/index.js.map +0 -1
  54. package/dist/lead.d.ts.map +0 -1
  55. package/dist/lead.js.map +0 -1
  56. package/dist/llms-txt.d.ts.map +0 -1
  57. package/dist/llms-txt.js.map +0 -1
  58. package/dist/plugins.d.ts.map +0 -1
  59. package/dist/plugins.js.map +0 -1
  60. package/dist/project.d.ts.map +0 -1
  61. package/dist/project.js.map +0 -1
  62. package/dist/serialize.d.ts.map +0 -1
  63. package/dist/serialize.js.map +0 -1
  64. package/dist/sitemap.d.ts.map +0 -1
  65. package/dist/sitemap.js.map +0 -1
  66. package/dist/taxonomy.d.ts.map +0 -1
  67. package/dist/taxonomy.js.map +0 -1
package/dist/project.d.ts CHANGED
@@ -1,4 +1,43 @@
1
1
  import type { ExportPage, NavItem } from "@dogsbay/types";
2
+ import { type SiteChrome } from "@dogsbay/site-files";
3
+ import { type VersionMenu, type ProductModel } from "@dogsbay/site-files";
4
+ import { type BlogEmitConfig } from "./blog.js";
5
+ import { type RedirectsConfig } from "./redirects.js";
6
+ /**
7
+ * Astro `outDir` for a Cloudflare Workers deploy mounted on a host subpath.
8
+ *
9
+ * Workers Static Assets resolves the FULL request pathname against the
10
+ * asset manifest and strips nothing. A site mounted at `dogsbay.ai/blog/*`
11
+ * is therefore asked for `/blog/index.html`, and unless the build output
12
+ * actually contains `blog/`, every request 404s. Astro's `base` does not
13
+ * do this: it prefixes generated URLs (including `/blog/_astro/...`) but
14
+ * leaves the emitted files at `dist/` root. Setting `outDir` to
15
+ * `./dist<urlBase>` is what makes the two agree.
16
+ *
17
+ * GitHub Pages needs the OPPOSITE and must not get this. There the
18
+ * uploaded artifact IS the site root, served at `https://<user>.github.io/
19
+ * <repo>/`, so the host supplies the prefix: URLs must carry it, files
20
+ * must not. Emitting `outDir` for a Pages build would produce
21
+ * `/<repo>/<repo>/`. Hence the deploy-target gate — the same `site.url`
22
+ * deliberately yields different layouts per target.
23
+ *
24
+ * Returns `undefined` when the target is not Workers or the site sits at
25
+ * the host root (no path in `site.url`), which is the common case.
26
+ */
27
+ export declare function workersSubpathOutDir(deploy: AstroProjectOptions["deploy"], urlBase: string): string | undefined;
28
+ /**
29
+ * Build the `excludeFromRoutes` predicate.
30
+ *
31
+ * Exported because more than one emitter has to agree on which pages
32
+ * become routes. The blog listed excluded pages as posts, producing index
33
+ * cards and Newer/Older links to pages that were never emitted — a 404
34
+ * from the site's own front page.
35
+ *
36
+ * A single-segment pattern matches ANY segment (fragment dirs symlink to
37
+ * many depths in AsciiBinder corpora); a multi-segment pattern matches as
38
+ * a leading path prefix, so `welcome/_internal` excludes only that tree.
39
+ */
40
+ export declare function makeSlugExcluder(excludeFromRoutes?: string[]): (slug: string) => boolean;
2
41
  export interface AstroProjectOptions {
3
42
  siteName?: string;
4
43
  theme?: string;
@@ -6,13 +45,77 @@ export interface AstroProjectOptions {
6
45
  repoUrl?: string;
7
46
  editUri?: string;
8
47
  copyright?: string;
48
+ /**
49
+ * The site's chrome (@dogsbay/site-files `siteChrome`: logo, colour mode, announcement, header
50
+ * links, footer columns), written into site.json as `chrome`. With it, `copyright` is inline
51
+ * Markdown (the agreed rule); without it (legacy callers), copyright stays HTML as given.
52
+ */
53
+ chrome?: SiteChrome;
54
+ /** The chrome's logo files, absolute, checked inside the project by the caller. */
55
+ chromeLogoFiles?: {
56
+ light: string;
57
+ dark?: string;
58
+ };
59
+ /** The line under the site name in the sidebar header (`site.tagline`). Default "Documentation". */
60
+ tagline?: string;
61
+ /** `content.imageCaptions`: a titled block image is a captioned figure. */
62
+ imageCaptions?: "title" | false;
63
+ /** `content.html`: "sanitize" filters raw HTML and directive attributes before serializing (@dogsbay/render-html/sanitize). */
64
+ html?: "keep" | "sanitize";
65
+ /**
66
+ * "Powered by DogsBay" footer attribution. Default ON — an unset value
67
+ * means true. `poweredBy: false` in dogsbay.config.yml removes it, and
68
+ * removes it completely: no markup, no link, no trace. See
69
+ * docs/powered-by.md.
70
+ */
71
+ poweredBy?: boolean;
9
72
  /**
10
73
  * Brand keywords for the site. Emitted into `src/data/site.json`
11
74
  * so the `seo/h1-brand-keyword` audit rule can read them.
12
75
  */
13
76
  brandKeywords?: string[];
77
+ /**
78
+ * Site-wide noindex. When true, every emitted page passes
79
+ * `noindex={true}` to DocsLayout regardless of frontmatter, and
80
+ * the sitemap emits zero `<url>` entries. Pages can ESCALATE
81
+ * (frontmatter `noindex: true` still works) but not opt out.
82
+ * See plans/site-level-robots-meta.md.
83
+ */
84
+ noindex?: boolean;
85
+ /**
86
+ * Site-wide nofollow. Same one-way semantics as `noindex` — site
87
+ * forces, page frontmatter `nofollow: true` can escalate but
88
+ * cannot opt out. Independent of `noindex`.
89
+ */
90
+ nofollow?: boolean;
14
91
  /** Source project directory (for copying extra_css, assets, etc.) */
15
92
  sourceDir?: string;
93
+ /**
94
+ * External asset directories mounted into the `_assets` convention. Each
95
+ * dir's CONTENTS are copied to `public/_assets/` (e.g. a Docusaurus `static/`
96
+ * dir, whose `/img/x` refs the importer rewrote to `/_assets/img/x`).
97
+ * `into` targets an `_assets/<into>` subdir; `mediaOnly` copies only media
98
+ * files (for mounts whose dir is the docs tree itself).
99
+ */
100
+ assetMounts?: {
101
+ dir: string;
102
+ into?: string;
103
+ mediaOnly?: boolean;
104
+ root?: string;
105
+ }[];
106
+ /**
107
+ * Per-source asset directories with the URL prefix their content refs
108
+ * were rewritten with. Used by multi-source (versioned/localised) builds
109
+ * so EACH source's assets are copied under `public/<urlPrefix>/...`
110
+ * (e.g. `public/8.8/_assets/...`) and same-path images across versions
111
+ * don't collide. When set, it REPLACES the single-`sourceDir` asset copy
112
+ * (which only ever copied the first source, version-less). `urlPrefix`
113
+ * empty/absent copies to `public/...` flat (the baseline source).
114
+ */
115
+ assetSourceDirs?: {
116
+ dir: string;
117
+ urlPrefix?: string;
118
+ }[];
16
119
  /** Custom CSS files from mkdocs.yml extra_css */
17
120
  extraCss?: string[];
18
121
  /** Enable Astro image optimization (copies to src/assets/ instead of public/) */
@@ -49,6 +152,8 @@ export interface AstroProjectOptions {
49
152
  * `taxonomies.tags.labels`. URLs continue to use slugs.
50
153
  */
51
154
  tagLabels?: import("@dogsbay/types").SiteConfig["tagLabels"];
155
+ /** Automatic chip colors. Sourced from `taxonomies.tags.autoColor`. */
156
+ tagAutoColor?: import("@dogsbay/types").SiteConfig["tagAutoColor"];
52
157
  /**
53
158
  * Map of taxonomy name → index path, sourced from declared
54
159
  * `taxonomies` entries. Lets renderer components surface a link
@@ -91,13 +196,51 @@ export interface AstroProjectOptions {
91
196
  id: string;
92
197
  label?: string;
93
198
  eol?: boolean;
199
+ prerelease?: boolean;
200
+ hidden?: boolean;
201
+ canonical?: "self";
202
+ noindex?: boolean;
203
+ sitemap?: boolean;
204
+ badge?: boolean;
205
+ path?: "";
94
206
  }>;
207
+ /**
208
+ * Units whose home has no page, forwarded to their first page (site-files `homeForwards`):
209
+ * `[from, to]` site paths without the base path, written as redirects.
210
+ */
211
+ homeForwards?: Array<[string, string]>;
212
+ /** Leave out a redirect the build cannot honour, with a warning, instead of failing. */
213
+ allowBrokenRedirects?: boolean;
214
+ /**
215
+ * The version menu's links and limit (`content.versionMenu`, @dogsbay/site-files
216
+ * version-menu.ts). With a `products:` block each product's comes from the model.
217
+ */
218
+ versionMenu?: VersionMenu;
95
219
  /**
96
220
  * Which version is the default. Marked in switcherMap.json so
97
- * the switcher can highlight it; PR 4c wires the default-
98
- * version redirect that uses this same field.
221
+ * the switcher can highlight it, and drives the default-version
222
+ * redirect middleware. A pre-release version is never the
223
+ * default (enforced at config load).
99
224
  */
100
225
  defaultVersion?: string;
226
+ /**
227
+ * With a `products:` block: the model from @dogsbay/site-files
228
+ * (`productModel`). Each product's own versions and default then drive
229
+ * canonicals, the version switcher (`productVersions`), the forward from
230
+ * a product's root to its default version, and the data files
231
+ * `_dogsbay/versions.js` and `<unit home>_dogsbay/pages.js`.
232
+ */
233
+ products?: ProductModel;
234
+ /**
235
+ * The project's own `_headers` / `_redirects` (from the root of a source served at the site
236
+ * root): written first, the generated rules after, generated ones they already decide left out
237
+ * (@dogsbay/site-files host-files.ts, as dogsbay-ssg does). With its own `_redirects` the file is
238
+ * written whatever `deploy` says, since the project's host reads it.
239
+ */
240
+ hostFiles?: {
241
+ headers?: string;
242
+ redirects?: string;
243
+ };
101
244
  /**
102
245
  * Declared locales for the i18n axis. Same role as
103
246
  * `versions` for the locale axis.
@@ -112,12 +255,89 @@ export interface AstroProjectOptions {
112
255
  */
113
256
  defaultLocale?: string;
114
257
  /**
115
- * When set, emit a deploy config file + dev dep + script for the
116
- * named platform. Only "cloudflare-workers" supported today.
117
- * Other adapters (netlify, vercel, gh-pages) follow the same shape;
118
- * left unimplemented per Phase 1 scope.
258
+ * When set, emit deploy artifacts for the named platform.
259
+ *
260
+ * - `"cloudflare-workers"` — `wrangler.jsonc` + `wrangler` devDep +
261
+ * `deploy` script.
262
+ * - `"github-pages"` — `.github/workflows/deploy.yml` (Astro →
263
+ * `actions/deploy-pages` workflow) + `public/.nojekyll`.
264
+ *
265
+ * Both targets scaffold their files write-if-missing — re-running
266
+ * the build never clobbers an author-edited workflow YAML or
267
+ * wrangler config.
268
+ */
269
+ /**
270
+ * Other sites on this host whose sitemap / llms.txt this site
271
+ * aggregates. See `AggregateSource` in `@dogsbay/cli` and
272
+ * plans/subpath-robots-txt.md.
273
+ */
274
+ aggregates?: {
275
+ name: string;
276
+ description?: string;
277
+ url?: string;
278
+ sitemap?: string;
279
+ llmsTxt?: string;
280
+ }[];
281
+ deploy?: "cloudflare-workers" | "github-pages";
282
+ /**
283
+ * `redirects:` from dogsbay.config.yml — source path → target, or an object
284
+ * with a status. Merged with `redirect:` / `aliases:` page frontmatter and
285
+ * emitted per deploy target. See plans/redirects-and-aliases.md.
286
+ */
287
+ redirects?: RedirectsConfig;
288
+ /**
289
+ * Astro `build.inlineStylesheets` policy.
290
+ *
291
+ * - `"auto"` (default): inline only stylesheets below 4 KB,
292
+ * externalize the rest. Best for multi-page sites.
293
+ * - `"always"`: inline every stylesheet. Best for single-page
294
+ * sites where first-paint latency dominates.
295
+ * - `"never"`: always externalize. Maximizes cache reuse.
296
+ *
297
+ * Mirrors `dogsbay.config.yml`'s `build.inlineStylesheets`. Flows
298
+ * through `astro.config.dogsbay.mjs` so changes propagate without
299
+ * a scaffold rebuild. See docs/perf-tuning.md.
300
+ */
301
+ inlineStylesheets?: "auto" | "always" | "never";
302
+ /**
303
+ * Sidebar navigation render mode.
304
+ *
305
+ * - `"client"` (default): emit `<DocsNavClient />` — an empty placeholder
306
+ * that a tiny client script hydrates from `/_dogsbay/nav.json`.
307
+ * Page HTML stays small regardless of nav size; the nav DOM persists
308
+ * across view transitions. Trade-off: no-JS users see no sidebar
309
+ * nav, search-engine crawlers reach pages via `sitemap.xml` and
310
+ * in-content links rather than the sidebar.
311
+ * - `"ssr-full"`: render the full nav tree into every page's HTML.
312
+ * Best for tiny sites or strict no-JS / SEO contexts.
313
+ *
314
+ * See plans/client-rendered-nav.md.
119
315
  */
120
- deploy?: "cloudflare-workers";
316
+ navMode?: "client" | "ssr-full";
317
+ /**
318
+ * Table-of-contents placement — forwarded to DocsLayout's `toc` prop.
319
+ * Mirrors `DogsbayConfig.toc`:
320
+ * - `"top"` (default) — expandable "On this page" at the top of the
321
+ * article; frees the right rail for plugin content (e.g. Ask AI).
322
+ * - `"popover"` — an "On this page" control in the header.
323
+ * - `"rail"` — the classic right-hand TOC sidebar. In this mode the rail
324
+ * belongs to the TOC, so the `RightRail` plugin region is not emitted.
325
+ * - `"off"` — no table of contents.
326
+ */
327
+ toc?: "top" | "popover" | "rail" | "off";
328
+ /**
329
+ * Repo root — the directory containing `dogsbay.config.yml`. The
330
+ * Astro project (`outputDir`) is typically a subdirectory like
331
+ * `<projectDir>/astro/`. Deploy artifacts that GitHub Actions
332
+ * needs at the repo root (`.github/workflows/deploy.yml`) are
333
+ * written here, while artifacts that ship inside the Astro build
334
+ * (e.g. `public/.nojekyll`) stay under `outputDir`.
335
+ *
336
+ * When unset, defaults to `outputDir` — covers flat-layout flows
337
+ * (`dogsbay convert --to astro`) where the Astro project IS the
338
+ * repo. site-init and site-build always pass it explicitly.
339
+ */
340
+ projectDir?: string;
121
341
  /**
122
342
  * Overwrite all files including maintainer-customizable scaffold
123
343
  * files (theme.css, astro.config.mjs, package.json, site.json,
@@ -143,6 +363,31 @@ export interface AstroProjectOptions {
143
363
  * to static `.md` files in `dist/`. Default `true`.
144
364
  */
145
365
  mdMirror?: boolean;
366
+ /**
367
+ * Granularity views — emit aggregate "single-page" views alongside the
368
+ * topic-grained pages. Additive: the topic site is unchanged; aggregates
369
+ * are quarantined (noindex + excludeFromSearch → robots/sitemap/pagefind/
370
+ * llms all exclude them) and kept out of nav. See plans/granularity-views.md.
371
+ *
372
+ * Per-node opt-in via the nav file's `single-page: yes | no | children`
373
+ * annotation (default "no"). `book: true` is the legacy all-on switch: it
374
+ * seeds the top-level groups as if each were `single-page: yes`, so a node's
375
+ * own annotation still overrides. `maxSinglePageMB` (default 3) is a safety
376
+ * cap — a rollup whose source exceeds it is skipped with a warning instead of
377
+ * building a multi-minute / multi-MB page. See plans/granularity-views.md and
378
+ * docs-dev/granularity-book-perf.md.
379
+ */
380
+ granularity?: {
381
+ book?: boolean;
382
+ maxSinglePageMB?: number;
383
+ };
384
+ /**
385
+ * Blog mode. When set, every emitted page wears `chrome="blog"` (no
386
+ * sidebar), carries a byline, and takes its prev/next from DATE order
387
+ * rather than nav order. The reverse-chron index itself is emitted
388
+ * separately by `emitBlogFiles`. See plans/blog-capability.md.
389
+ */
390
+ blog?: BlogEmitConfig;
146
391
  /**
147
392
  * `Content-Signal` directive for the AI training corpus permission
148
393
  * emitted in robots.txt. Default `"no"` — opt out of training by
@@ -160,6 +405,22 @@ export interface AstroProjectOptions {
160
405
  * search results emitted in robots.txt. Default `"yes"`.
161
406
  */
162
407
  aiSearch?: "yes" | "no";
408
+ /**
409
+ * Emit the Article 4 reservation-of-rights preamble above the
410
+ * `Content-Signal` line in robots.txt. Default `false`.
411
+ * See `CONTENT_SIGNAL_PREAMBLE` in @dogsbay/site-files.
412
+ */
413
+ contentSignalPreamble?: boolean;
414
+ /**
415
+ * Emit the non-standard `Llms-Txt:` line in robots.txt. Default
416
+ * `false` — see `AgentConfig.llmsTxtDirective` in `@dogsbay/cli`.
417
+ */
418
+ llmsTxtDirective?: boolean;
419
+ /**
420
+ * "When to use this" guidance for llms.txt. See
421
+ * `AgentConfig.llmsWhenToUse` in `@dogsbay/cli`.
422
+ */
423
+ llmsWhenToUse?: string;
163
424
  /**
164
425
  * Per-page LLM action UI ("Copy as markdown", "Open in Claude/
165
426
  * ChatGPT/Perplexity/Gemini"). When omitted, the cluster is not
@@ -168,6 +429,46 @@ export interface AstroProjectOptions {
168
429
  * See plans/llm-page-actions.md.
169
430
  */
170
431
  llmActions?: import("@dogsbay/types").SiteConfig["llmActions"];
432
+ /**
433
+ * Resolved glyphs for the internal/external link-icon affordance.
434
+ * Baked into `site.json` as `linkIcons` and consumed by `DocsLayout`.
435
+ * Omitted when the feature is off. See plans/link-resolution-and-icons.md.
436
+ */
437
+ linkIcons?: import("@dogsbay/types").SiteConfig["linkIcons"];
438
+ /**
439
+ * Patterns that mark slugs as fragments (no Astro route).
440
+ * Pages matching any pattern are written to neither
441
+ * `src/pages/*.astro` nor `src/pages/*.md.ts`. The `.md` source
442
+ * files remain on disk under `content/` so `{% include %}`
443
+ * directives in other pages can still resolve them; they just
444
+ * aren't reachable as URLs.
445
+ *
446
+ * Match semantics depend on whether the pattern contains `/`:
447
+ * - `"modules"` (single segment) matches ANY path segment of
448
+ * the slug equal to "modules" — `modules/foo`,
449
+ * `welcome/modules/foo`, `a/b/modules/c` all exclude.
450
+ * What AsciiBinder corpora want — fragment dirs symlink
451
+ * into section dirs so the same dir name appears at many
452
+ * depths.
453
+ * - `"foo/bar"` (multi-segment) matches as a leading prefix
454
+ * only — `foo/bar` and `foo/bar/baz` exclude, but
455
+ * `welcome/foo/bar` does not. For when a specific path
456
+ * tree is fragment territory.
457
+ *
458
+ * The companion signal — frontmatter `_fragment: true` — is also
459
+ * honoured (per-page opt-out, set by importers that know which
460
+ * `.md` files are include-only fragments vs navigable pages —
461
+ * `migrate-asciidoc` is the first such importer). Either signal
462
+ * is enough to skip; both stack.
463
+ *
464
+ * Typical use case: AsciiBinder-style corpora where shared
465
+ * fragments live under `modules/`, `_attributes/`, `snippets/`
466
+ * — the converter writes them as `.md` so includes resolve, but
467
+ * they have no business being navigable as standalone pages
468
+ * (and emitting 18k useless routes punishes the Astro compiler).
469
+ * See plans/build-at-scale.md.
470
+ */
471
+ excludeFromRoutes?: string[];
171
472
  }
172
473
  /**
173
474
  * Export pages + nav to a complete Astro project directory.
@@ -204,24 +505,95 @@ export declare function exportAstroProject(pages: ExportPage[], nav: NavItem[],
204
505
  * through the full scaffold path. `emitSiteScaffold` also calls it.
205
506
  */
206
507
  export declare function emitSiteConfig(outputDir: string, siteName: string, options: AstroProjectOptions): void;
508
+ /**
509
+ * Re-pin an existing site's `@dogsbay/*` dependencies to the building CLI's
510
+ * version. Safe to call on every build.
511
+ *
512
+ * `package.json` is scaffold-once, and for a long time this ran only from
513
+ * `emitSiteScaffold`, which `site build` never calls — so the guard against
514
+ * version drift was unreachable from the one command where drift happens.
515
+ * Measured on openshift-docs-markdown: a site rebuilt weekly for months kept
516
+ * installing the `@dogsbay/docs-layout` written at its first scaffold, so no
517
+ * change to a runtime component ever reached it. Its sibling escaped only
518
+ * because that workflow passes `--force`, which re-scaffolds.
519
+ *
520
+ * Returns the changes made, so the caller can report them: a build that
521
+ * silently edits a tracked file is worse than the drift it fixes.
522
+ */
523
+ export declare function syncSiteDependencies(outputDir: string, options?: {
524
+ local?: boolean;
525
+ }): string[];
207
526
  export declare function emitSiteScaffold(outputDir: string, siteName: string, options: AstroProjectOptions, writeScaffold: boolean): number;
208
527
  /**
209
- * Emit content-tier files: nav.json, every page's .astro, the per-page
210
- * .md mirror endpoint (when `mdMirror` is enabled), and the index
211
- * redirect. Returns the count of pages emitted and the merged nav for
212
- * downstream consumers (llms.txt builder).
528
+ * Nav entries come from a project's own TOC files (toctrees, `_toc.yml`,
529
+ * `myst.yml`, nav.yml), i.e. from content. An href with a scheme other than
530
+ * http(s)/mailto/tel — `javascript:` above all — is dropped (the entry keeps
531
+ * its label and children), so it cannot reach the sidebar, nav.json or a
532
+ * page's previous/next link.
213
533
  */
534
+ export declare function dropUnsafeNavHrefs(items: NavItem[]): NavItem[];
214
535
  export declare function emitAstroPages(pages: ExportPage[], nav: NavItem[], outputDir: string, options: AstroProjectOptions): Promise<{
215
536
  generated: number;
216
537
  outputNav: NavItem[];
538
+ /**
539
+ * Output paths (relative to outputDir, OS-native separators) of the
540
+ * `.astro` files just written. Used by passthrough emit to detect
541
+ * collisions with hand-authored `.astro` files declared in nav.yml
542
+ * — see plans/passthrough-astro-pages.md.
543
+ */
544
+ generatedPaths: Set<string>;
217
545
  }>;
546
+ /** Passthrough source → destination pair, computed by the CLI's collector. */
547
+ export interface PassthroughCopy {
548
+ /** Absolute path to the source file (under contentDir). */
549
+ sourceAbs: string;
550
+ /**
551
+ * Output path relative to outputDir, OS-native separators. Same
552
+ * shape as `emitAstroPages` `generatedPaths` so the collision
553
+ * check can use a plain `Set.has`.
554
+ */
555
+ outputRelPath: string;
556
+ /** Source path relative to contentDir, for error messages. */
557
+ source: string;
558
+ }
559
+ /**
560
+ * Copy each passthrough `.astro` source to its computed output path.
561
+ * Aborts with a clear error if the destination is already in
562
+ * `generatedPaths` (a generated page from `emitAstroPages` would
563
+ * silently overwrite the hand-authored file otherwise).
564
+ */
565
+ export declare function emitPassthroughAstroPages(copies: PassthroughCopy[], outputDir: string, generatedPaths: Set<string>): {
566
+ copied: number;
567
+ };
218
568
  /**
219
569
  * Emit `public/robots.txt` with `Content-Signal` directives + sitemap
220
570
  * link. Always overwrites — the file's contents are pure derivation
221
571
  * from `options`. Maintainers wanting custom Disallow rules layer
222
572
  * them at the CDN level.
223
573
  */
224
- export declare function emitConfigDerivedFiles(outputDir: string, options: AstroProjectOptions): void;
574
+ export declare function emitConfigDerivedFiles(outputDir: string, options: AstroProjectOptions, pages?: ExportPage[]): void;
575
+ /**
576
+ * Per-deploy-target artifact emission.
577
+ *
578
+ * Called from `emitSiteScaffold` (with `forceOverwrite=writeScaffold`
579
+ * so `--force` regenerates from template) and from `dogsbay site
580
+ * build` (with `forceOverwrite=false` so an existing site can adopt
581
+ * a deploy target by editing config and rebuilding — the missing
582
+ * artifact gets created on the next build).
583
+ *
584
+ * Emit policy is the union: write when forced OR when the file is
585
+ * missing. Author edits to e.g. the workflow YAML survive every
586
+ * regular build.
587
+ *
588
+ * Currently handles `github-pages` (workflow + .nojekyll). The
589
+ * existing `cloudflare-workers` artifacts (wrangler.jsonc + package
590
+ * scripts) stay in the scaffold-only path because they overlap with
591
+ * scaffold-only files (package.json scripts, devDependencies). A
592
+ * future refactor could fold them in here too.
593
+ */
594
+ export declare function emitDeployArtifacts(outputDir: string, options: AstroProjectOptions, opts?: {
595
+ forceOverwrite: boolean;
596
+ }): void;
225
597
  /**
226
598
  * Shape of the emitted `src/data/switcherMap.json` file.
227
599
  * Switcher components import this JSON directly, so the shape
@@ -251,7 +623,13 @@ export interface SwitcherMap {
251
623
  id: string;
252
624
  label?: string;
253
625
  eol?: boolean;
626
+ prerelease?: boolean;
627
+ hidden?: boolean;
254
628
  default?: boolean;
629
+ /** Served at the site root (`path: ""`): its pages have no version segment. */
630
+ root?: boolean;
631
+ /** "Version: <label>" above each page's title. */
632
+ badge?: boolean;
255
633
  }>;
256
634
  /**
257
635
  * Declared locales in declaration order. Same role as
@@ -269,6 +647,44 @@ export interface SwitcherMap {
269
647
  * the full URL plus the (locale, version) combo it represents.
270
648
  */
271
649
  byLogicalKey: Record<string, SwitcherVariant[]>;
650
+ /**
651
+ * With a `products:` block: each product's version rows per locale, keyed
652
+ * `<product|_>/<locale|_>`, in config order, hidden versions left out, each
653
+ * with its home URL (where the row goes when the page is not in it). The
654
+ * version switcher uses these instead of `versions`.
655
+ */
656
+ productVersions?: Record<string, Array<{
657
+ id: string;
658
+ label?: string;
659
+ eol?: boolean;
660
+ prerelease?: boolean;
661
+ default?: boolean;
662
+ badge?: boolean;
663
+ home: string;
664
+ }>>;
665
+ /**
666
+ * The version menu's links (hrefs as served, base path included) and limit,
667
+ * keyed by product name, `_` for the site-wide versions and the unnamed
668
+ * source. Left out when no menu has any.
669
+ */
670
+ versionMenu?: Record<string, {
671
+ links: Array<{
672
+ label: string;
673
+ href: string;
674
+ }>;
675
+ limit?: number;
676
+ }>;
677
+ /**
678
+ * With a `products:` block and two or more products: the product menu per
679
+ * locale (`<locale|_>`), in the block's order, each entry going to the
680
+ * product's home (its default version, in the locale when it has one) —
681
+ * site-files `productSwitcher`, as dogsbay-ssg's product menu.
682
+ */
683
+ products?: Record<string, Array<{
684
+ name: string;
685
+ label: string;
686
+ home: string;
687
+ }>>;
272
688
  }
273
689
  export interface SwitcherVariant {
274
690
  /** Present when the locale axis is active for this site. */
@@ -317,4 +733,36 @@ export declare function emitMissingTranslationStubs(pages: ExportPage[], outputD
317
733
  * `emitAstroPages` (they share the page-loop's serialization step).
318
734
  */
319
735
  export declare function emitAgentReadinessFiles(pages: ExportPage[], outputNav: NavItem[], outputDir: string, siteName: string, options: AstroProjectOptions): void;
320
- //# sourceMappingURL=project.d.ts.map
736
+ /**
737
+ * Build the contents of `public/_headers` (Cloudflare Pages / Workers
738
+ * Static Assets convention). Emits a global RFC 8288 Link header
739
+ * pointing at this mount's llms.txt index, so agents don't need to
740
+ * parse HTML to discover the LLM-friendly content listing.
741
+ *
742
+ * The Link target is basePath-prefixed (`</docs/llms.txt>` for a
743
+ * `/docs` mount) — matches where the platform actually emits
744
+ * llms.txt under the per-mount layout.
745
+ */
746
+ /**
747
+ * URL for `<link rel="icon">`, or `false` when the project ships no
748
+ * favicon.
749
+ *
750
+ * The scaffold deliberately ships none — authors drop their own into
751
+ * `public/`. Emitting the link unconditionally therefore advertised a
752
+ * 404 on every generated site. Checks `.ico` then `.svg`, matching the
753
+ * two the scaffold documents.
754
+ */
755
+ export declare function faviconHref(outputDir: string, urlBase: string): string | false;
756
+ /**
757
+ * The version served at the site root: the `defaultVersion` when its
758
+ * `versions` entry has `path: ""` (the CLI's config load allows it on no
759
+ * other version). Its pages have no version segment.
760
+ */
761
+ export declare function rootVersionOf(options: Pick<AstroProjectOptions, "versions" | "defaultVersion">): string | undefined;
762
+ /**
763
+ * Copy the UI component folders the serializer can emit into the site's
764
+ * `src/components/ui/`, skipping any that exist (project-owned, maybe
765
+ * edited). Returns the names added. `site build` calls it so a component
766
+ * introduced in a release (Kbd, FileTree) reaches sites scaffolded earlier.
767
+ */
768
+ export declare function copyComponents(outputDir: string): string[];