@getvitops/astro 1.0.0 → 2.1.0

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/index.d.mts CHANGED
@@ -1,7 +1,150 @@
1
- import { LegalOutput, StylesheetFormat } from "@getvitops/generator";
1
+ import { LegalOutput, SiteFont, StylesheetFormat } from "@getvitops/generator";
2
+ import { generateIconInclude } from "@getvitops/utils";
3
+ import { OutputKind } from "@getvitops/utils/media";
2
4
  import { AstroIntegration } from "astro";
3
5
  export * from "@getvitops/utils";
4
6
 
7
+ //#region src/analytics.d.ts
8
+ /**
9
+ * The `<Analytics />` resolution layer — provider config in, the exact tags to
10
+ * emit out.
11
+ *
12
+ * Kept separate from `Analytics.astro` for the same reason `seo.ts` is separate
13
+ * from `Seo.astro`: everything decidable is a pure function and asserted in
14
+ * `analytics.test.ts`, and the component only renders what this returns.
15
+ *
16
+ * Two properties here are the point of the whole file:
17
+ *
18
+ * - **Which consent category a provider needs is derived, never declared.** It
19
+ * follows from whether that provider sets cookies, which follows from its own
20
+ * configuration (Matomo with `disableCookies` is genuinely cookieless; Matomo
21
+ * with `cookies: true` is not). A consumer cannot mark Google Analytics
22
+ * `necessary` to skip a banner, because `setsCookies` isn't theirs to set.
23
+ * - **The same fact drives the legal documents.** `@getvitops/generator`'s
24
+ * `legal/providers.ts` maps the *site config's* `analytics` block onto named
25
+ * processors with cookie lists. If a provider is configured here but not
26
+ * there, the site runs a tag its own cookie notice doesn't disclose — so the
27
+ * integration warns, and `warnings` is returned as data so that check is a
28
+ * test rather than a log line someone might scroll past.
29
+ */
30
+ /**
31
+ * When a tag is allowed to load. Third-party analytics is never worth a
32
+ * millisecond of the critical path, so the default puts every tag after `load`.
33
+ */
34
+ type AnalyticsStrategy = 'idle' | 'async' | 'interaction';
35
+ /**
36
+ * The consent vocabulary, mirroring `@getvitops/core`'s `consent/store.ts`.
37
+ * Mirrored rather than imported because this value is `JSON.stringify`d into the
38
+ * virtual module and the component reads it at build time, while core's copy is a
39
+ * browser runtime — `consent.test.ts` and `analytics.test.ts` pin both ends.
40
+ */
41
+ type ConsentCategory = 'necessary' | 'analytics' | 'marketing' | 'preferences';
42
+ type OptionalConsentCategory = Exclude<ConsentCategory, 'necessary'>;
43
+ interface GoogleAnalyticsOptions {
44
+ /** Measurement ID, e.g. `G-XXXXXXXXXX`. */
45
+ id: string;
46
+ /**
47
+ * Which category gates it (default `analytics`). Set `marketing` when the
48
+ * property feeds Google Ads — the tag is the same, the permission isn't.
49
+ */
50
+ category?: OptionalConsentCategory;
51
+ /** Extra `gtag('config', id, …)` parameters, e.g. `{ send_page_view: false }`. */
52
+ config?: Record<string, string | number | boolean>;
53
+ }
54
+ interface ClarityOptions {
55
+ /** Clarity project ID. */
56
+ id: string;
57
+ category?: OptionalConsentCategory;
58
+ }
59
+ interface MatomoOptions {
60
+ /** Instance base URL — self-hosted, or `https://<you>.matomo.cloud`. */
61
+ url: string;
62
+ /** Site ID within that instance. */
63
+ siteId: string | number;
64
+ /**
65
+ * Let Matomo set its cookies (default **false**).
66
+ *
67
+ * The default is what makes Matomo the cookieless option: with
68
+ * `disableCookies` it stores no identifier on the device, needs no banner, and
69
+ * the generated cookie notice can state positively that it sets none. Turning
70
+ * this on gives you returning-visitor metrics and a consent obligation.
71
+ */
72
+ cookies?: boolean;
73
+ }
74
+ interface PlausibleOptions {
75
+ /** The domain as registered in Plausible, e.g. `example.com`. */
76
+ domain: string;
77
+ /** Script URL — override for a self-hosted instance or a custom-events build. */
78
+ src?: string;
79
+ }
80
+ interface GetvitopsAnalyticsOptions {
81
+ googleAnalytics?: string | GoogleAnalyticsOptions;
82
+ clarity?: string | ClarityOptions;
83
+ matomo?: MatomoOptions;
84
+ plausible?: string | PlausibleOptions;
85
+ /** When tags load (default `'idle'`). */
86
+ strategy?: AnalyticsStrategy;
87
+ }
88
+ /**
89
+ * The consent gate, configured on the integration rather than inside `analytics`.
90
+ *
91
+ * That placement is the design, not an accident: analytics is one consumer of
92
+ * consent, not its owner. A/B assignment, account personalisation and third-party
93
+ * embeds gate on the same choice via `data-consent`, and a site can enable the
94
+ * banner with no analytics configured at all.
95
+ */
96
+ interface GetvitopsConsentOptions {
97
+ /**
98
+ * Categories the banner offers. Defaults to the ones the configured providers
99
+ * actually need — offering a choice nothing is waiting on is noise.
100
+ */
101
+ categories?: OptionalConsentCategory[];
102
+ /** Link the banner to the cookie notice (`vitops legal` renders one). */
103
+ policyUrl?: string;
104
+ }
105
+ /** One tag, fully resolved. */
106
+ interface ResolvedTag {
107
+ key: 'googleAnalytics' | 'clarity' | 'matomo' | 'plausible';
108
+ /** The provider as a reader would recognise it — used in warnings. */
109
+ provider: string;
110
+ category: ConsentCategory;
111
+ setsCookies: boolean;
112
+ /** Names (or `prefix*` patterns) to clear when consent is withdrawn. */
113
+ cookies: string[];
114
+ strategy: AnalyticsStrategy;
115
+ /**
116
+ * Emitted inert (`type="text/plain"`) for the runtime to activate, rather than
117
+ * as a live `<script>`. False only for the one case that needs no runtime at
118
+ * all: a cookieless provider with `strategy: 'async'`.
119
+ */
120
+ gated: boolean;
121
+ /** Bootstrap JS. Runs before `src`, so a queue is populated before it drains. */
122
+ inline: string;
123
+ src: string | null;
124
+ attrs: Record<string, string>;
125
+ }
126
+ interface ResolvedAnalytics {
127
+ tags: ResolvedTag[];
128
+ /** Does anything here need `@getvitops/core/consent` loaded? */
129
+ needsRuntime: boolean;
130
+ /** Configuration problems, as prose. The integration logs these. */
131
+ warnings: string[];
132
+ }
133
+ interface ResolveAnalyticsContext {
134
+ /** Is the consent gate enabled on this site (`getvitops({ consent })`)? */
135
+ consent?: boolean;
136
+ }
137
+ /**
138
+ * Resolve the configured providers into the tags to emit.
139
+ *
140
+ * An invalid provider is dropped with a warning rather than throwing: one
141
+ * malformed ID should not take down a build, and a missing tag is visible in the
142
+ * output while a failed build is just a red wall.
143
+ */
144
+ declare function resolveAnalytics(opts: GetvitopsAnalyticsOptions | undefined, ctx?: ResolveAnalyticsContext): ResolvedAnalytics;
145
+ /** Which optional categories a set of tags actually needs a visitor to decide. */
146
+ declare function consentCategories(tags: ResolvedTag[]): OptionalConsentCategory[];
147
+ //#endregion
5
148
  //#region src/seo.d.ts
6
149
  /**
7
150
  * The `<Seo />` resolution layer — site-level defaults merged with per-page props
@@ -34,6 +177,11 @@ interface GetvitopsSeoOptions {
34
177
  /**
35
178
  * Page-title pattern; `%s` is the page's own title. e.g. `'%s · Acme'`.
36
179
  *
180
+ * Applies to `<title>` only. `og:title`/`twitter:title` get the untemplated
181
+ * title: a social card already shows `og:site_name` and the domain, so the
182
+ * suffix would sit directly above the brand it repeats. Override per page with
183
+ * `ogTitle`.
184
+ *
37
185
  * Skipped when a page's title already equals `siteName` — a homepage titled
38
186
  * "Acme" emits `Acme`, not `Acme · Acme` — and never applied to `defaultTitle`.
39
187
  */
@@ -70,6 +218,12 @@ interface GetvitopsSeoOptions {
70
218
  interface SeoProps {
71
219
  /** Page title, before `titleTemplate` is applied. */
72
220
  title?: string;
221
+ /**
222
+ * `og:title`/`twitter:title`, when the social headline should differ from
223
+ * `title`. Defaults to `title` **without** `titleTemplate` — see the note on
224
+ * `titleTemplate` for why the suffix is dropped there.
225
+ */
226
+ ogTitle?: string;
73
227
  description?: string;
74
228
  /** Overrides the computed canonical. Relative values resolve against `site`. */
75
229
  canonical?: string;
@@ -132,6 +286,8 @@ interface SeoNameTag {
132
286
  /** Everything `<Seo />` renders, already decided. `null` means "emit nothing". */
133
287
  interface ResolvedSeo {
134
288
  title: string | null;
289
+ /** `og:title`/`twitter:title` — the page title without `titleTemplate`. */
290
+ socialTitle: string | null;
135
291
  description: string | null;
136
292
  canonical: string | null;
137
293
  robots: string | null;
@@ -179,9 +335,48 @@ interface GetvitopsFaviconOptions {
179
335
  themeColor?: string;
180
336
  backgroundColor?: string;
181
337
  }
338
+ /**
339
+ * Video encoding. A sibling of `favicon`, not a widening of `css`.
340
+ *
341
+ * Mirrors `VitopsMediaOptions` in `@getvitops/vite`, which is where it runs — see
342
+ * the `media` field on `GetvitopsOptions` for why.
343
+ */
344
+ interface GetvitopsMediaOptions {
345
+ /** Directory of unprocessed video, walked recursively. Default: `'raw'`. */
346
+ raw?: string;
347
+ /** Where encoded outputs go. Default: `'src/assets/processed'`. */
348
+ out?: string;
349
+ /** Cap the output width, keeping aspect ratio. Default 1920; 0 disables. */
350
+ maxWidth?: number;
351
+ /** Quality on VP9's CRF scale (0–63, lower is better). Default 32. */
352
+ crf?: number;
353
+ /** Optional bitrate ceiling, e.g. `'2M'`. Absent means constant quality. */
354
+ maxBitrate?: string;
355
+ /** Keep the audio track. Default false — the common case is a muted loop. */
356
+ audio?: boolean;
357
+ /** Timestamp (seconds) the poster frame comes from. Default 0. */
358
+ posterTime?: number;
359
+ /** Which outputs to produce. Default: webm, mp4 and a poster. */
360
+ outputs?: OutputKind[];
361
+ /** Cache file. Default `.vitops/media-manifest.json`. */
362
+ manifest?: string;
363
+ }
182
364
  interface GetvitopsCssOptions {
183
- /** Path to design-system.json (default 'design-system.json'). */
365
+ /**
366
+ * Path to the config (default `'design-system.json'`).
367
+ *
368
+ * May be a `design-system.json` **or** the larger site config that embeds one
369
+ * (`company.json` / `site.json`) — they are told apart by shape. Pointing this
370
+ * at a site config makes the top-level `site` option redundant and lets
371
+ * `legal` and `fonts` default their own `input` to it, so the path is declared
372
+ * once.
373
+ */
184
374
  input?: string;
375
+ /**
376
+ * Which `designSystem.themes` entry to build, when `input` is a site config.
377
+ * Default: the config's `defaultTheme`, else `default`.
378
+ */
379
+ theme?: string;
185
380
  /**
186
381
  * Output format (default 'tailwind'). Narrower than the generator's `Format`
187
382
  * on purpose: this option exists to produce a stylesheet to inject, and the
@@ -199,10 +394,36 @@ interface GetvitopsCssOptions {
199
394
  * only your own pages (and previews rendered through them) are styled.
200
395
  */
201
396
  inject?: boolean;
397
+ /**
398
+ * Also flip to dark when the visitor's OS asks and they have made no explicit
399
+ * choice — `@media (prefers-color-scheme: dark)`.
400
+ *
401
+ * Off by default: turning it on flips the site dark for dark-OS visitors, which
402
+ * is a visible change to an existing site. Turning it **on** is what makes
403
+ * `<color-scheme-toggle>`'s "System" position do anything (System removes the
404
+ * theme attribute, so without this block it falls through to light), and it is
405
+ * the only way a no-JS page gets the OS appearance at all.
406
+ *
407
+ * The site config's `designSystem.defaultColorScheme: "system"` says the same thing and is the
408
+ * better home for it when you have one — this option wins if both are set, and
409
+ * exists because requiring a whole `SiteConfig` to set one boolean would be out
410
+ * of proportion.
411
+ */
412
+ systemColorScheme?: boolean;
202
413
  }
203
- interface GetvitopsLegalOptions {
204
- /** Path to the site config (JSON) the documents are rendered from. */
414
+ interface GetvitopsSiteOptions {
415
+ /** Path to the site config (JSON). */
205
416
  input: string;
417
+ /** Environment whose A/B variant applies (default 'production'). */
418
+ siteEnv?: string;
419
+ }
420
+ interface GetvitopsLegalOptions {
421
+ /**
422
+ * Path to the site config (JSON) the documents are rendered from. Optional
423
+ * when the top-level `site` option is set — it defaults to that file, since
424
+ * they are almost always the same one.
425
+ */
426
+ input?: string;
206
427
  /**
207
428
  * Where to write them (default 'src/content/legal'). The default is a content
208
429
  * collection: the documents are markdown, and a collection is what lets a page
@@ -274,7 +495,44 @@ interface GetvitopsSitemapOptions {
274
495
  };
275
496
  }
276
497
  interface GetvitopsOptions {
498
+ /**
499
+ * Your site config — the one place to name it.
500
+ *
501
+ * A `SiteConfig` records site-level facts, several of which other options here
502
+ * need: `designSystem.defaultColorScheme` decides whether the generated colour layer
503
+ * carries a `prefers-color-scheme` block, `fonts` can supply the webfont
504
+ * declarations, and `legal` renders from it. Set this and each of those reads
505
+ * it, rather than repeating the path per feature. Every one can still be given
506
+ * explicitly, which wins.
507
+ *
508
+ * Needs `css`, since the generation runs in the Vite plugin `css` registers.
509
+ */
510
+ site?: GetvitopsSiteOptions;
277
511
  favicon?: GetvitopsFaviconOptions;
512
+ /**
513
+ * Encode raw video into WebM + an MP4 fallback + a poster frame.
514
+ *
515
+ * Import the results like any other asset, so Vite content-hashes them:
516
+ *
517
+ * ```astro
518
+ * import hero from '../assets/processed/hero.webm';
519
+ * import poster from '../assets/processed/hero.jpg';
520
+ * <video poster={poster.src} autoplay muted loop playsinline>
521
+ * <source src={hero} type="video/webm" />
522
+ * </video>
523
+ * ```
524
+ *
525
+ * Cached on source content and encode settings, so a rebuild costs a hash per
526
+ * file rather than an encode. **Commit the outputs and
527
+ * `.vitops/media-manifest.json`** — ffmpeg output is not reproducible across
528
+ * versions, so re-encoding in CI churns the diff on every toolchain bump.
529
+ *
530
+ * Needs `ffmpeg` on PATH, and fails the build without it rather than skipping:
531
+ * a page referencing a video that was never encoded is broken, not degraded.
532
+ *
533
+ * Needs `css`, since it runs in the Vite plugin `css` registers.
534
+ */
535
+ media?: GetvitopsMediaOptions;
278
536
  /** Copy + link the web-component bundles (default true). */
279
537
  webComponents?: boolean;
280
538
  /** Generate + auto-inject the design-system CSS. Off unless provided. */
@@ -301,6 +559,37 @@ interface GetvitopsOptions {
301
559
  * same renderer and works in any stack.
302
560
  */
303
561
  legal?: GetvitopsLegalOptions;
562
+ /**
563
+ * Load webfonts through Astro's Fonts API and emit `<Font />` for each from
564
+ * `<Head />`. Off unless provided.
565
+ *
566
+ * This is the seam the design system deliberately lacks. `design-system.json`'s
567
+ * `fonts` block holds **stacks only** — `--font-<name>` tokens and nothing else: no
568
+ * `@font-face`, no preload, no metrics-matched fallback. Declaring the family here
569
+ * makes the token resolvable *and* loaded, so the token keeps pointing at a
570
+ * `cssVariable` rather than at a literal stack the browser has no file for:
571
+ *
572
+ * ```js
573
+ * getvitops({ fonts: [{ name: 'League Spartan', provider: 'fontsource',
574
+ * cssVariable: '--font-league-spartan',
575
+ * weights: ['100 900'], subsets: ['latin'], preload: true }] })
576
+ * ```
577
+ * ```jsonc
578
+ * // design-system.json
579
+ * "fonts": { "display": "var(--font-league-spartan), sans-serif" }
580
+ * ```
581
+ *
582
+ * Pass a **string** instead to read the array from a site config's `fonts` block —
583
+ * the same declarations, kept next to the rest of the site's facts. (`siteEnv`
584
+ * picks the A/B variant, as in `legal`.) With the top-level `site` option set,
585
+ * plain `true` does the same thing without repeating the path.
586
+ *
587
+ * Independent of `css`: the loading runs in `astro:config:setup`, not in the Vite
588
+ * plugin. Both `<Head />` and the config entry are required — Astro's `fonts:`
589
+ * config resolves the files, and `<Font />` is what puts the `@font-face` on the
590
+ * page — so a declaration without `<Head />` in your layout loads nothing.
591
+ */
592
+ fonts?: boolean | string | SiteFont[] | GetvitopsFontsOptions;
304
593
  /**
305
594
  * Emit `sitemap-index.xml` + `sitemap-0.xml` via `@astrojs/sitemap`, and link it
306
595
  * from `<Head />`. Off unless provided; `true` uses its defaults.
@@ -327,8 +616,136 @@ interface GetvitopsOptions {
327
616
  * CMS — using both double-emits them.
328
617
  */
329
618
  seo?: GetvitopsSeoOptions;
619
+ /**
620
+ * Resolve semantic icon names centrally and, on a server build, derive which
621
+ * icons to bundle by scanning your source. Off unless provided; `true` uses
622
+ * the defaults below.
623
+ *
624
+ * Two separate jobs, and it is worth knowing which one you are buying:
625
+ *
626
+ * 1. **Naming.** `<Icon name="menu" />` resolves through the semantic map, so
627
+ * the icon set is a config value rather than something spelled out at every
628
+ * call site. A name containing `:` passes through untouched — that is the
629
+ * escape hatch for a set-specific glyph.
630
+ * 2. **Bundle size.** astro-icon is zero-config on a static build, but under
631
+ * `output: 'server'` it bundles EVERY icon in a set unless given an
632
+ * `include` map. That is the list consumers end up hand-maintaining. Here it
633
+ * is derived by scanning `scan` for icon references, merged with anything
634
+ * you declare. On a static build no `include` is passed at all, because
635
+ * there is nothing to trim.
636
+ *
637
+ * Names the scanner cannot read statically (`<Icon name={expr} />`) are
638
+ * reported with file and line, not guessed at — declare them in `include`.
639
+ */
640
+ icons?: boolean | GetvitopsIconsOptions;
641
+ /**
642
+ * Analytics tags for `<Analytics />` — Google Analytics, Microsoft Clarity,
643
+ * Matomo, Plausible. Off unless provided.
644
+ *
645
+ * Every tag loads off the critical path (`strategy`, default `'idle'`: after
646
+ * `load`, on an idle callback) and, when it sets cookies, only after consent.
647
+ *
648
+ * Which consent category a provider needs is derived from whether it sets
649
+ * cookies, not declared — so configuring a cookie-setting provider without
650
+ * `consent` warns rather than silently tracking everyone.
651
+ */
652
+ analytics?: GetvitopsAnalyticsOptions;
653
+ /**
654
+ * The consent gate: `@getvitops/core/consent` + `<CookieConsent />`. Off unless
655
+ * provided; `true` uses its defaults.
656
+ *
657
+ * A sibling of `analytics`, not part of it. The gate is general — anything
658
+ * marked `data-consent="<category>"` waits on the same choice, so A/B
659
+ * assignment, personalisation and third-party embeds use it too, and a site can
660
+ * enable it with no analytics configured at all.
661
+ *
662
+ * Pair it with `legal` so the cookie notice describes the categories this
663
+ * actually offers.
664
+ */
665
+ consent?: boolean | GetvitopsConsentOptions;
666
+ }
667
+ interface GetvitopsFontsOptions {
668
+ /** Path to a site config (JSON) whose `fonts` array holds the declarations. */
669
+ input?: string;
670
+ /** Declarations written inline; merged after anything `input` supplies. */
671
+ families?: SiteFont[];
672
+ /** Environment whose A/B variant applies to `input` (default 'production'). */
673
+ siteEnv?: string;
674
+ }
675
+ interface GetvitopsIconsOptions {
676
+ /** Icon set for UI chrome. Default `'fa7-solid'`. */
677
+ ui?: string;
678
+ /** Icon set for brand marks. Default `'simple-icons'`. */
679
+ brand?: string;
680
+ /**
681
+ * Weight for suffix-weighted sets like Phosphor (`'bold'`, `'fill'`, …).
682
+ * Ignored by sets that split weights across collections, e.g. Font Awesome.
683
+ */
684
+ weight?: string;
685
+ /**
686
+ * Icons to bundle, in `generateIconInclude`'s shape:
687
+ * `{ semantic: ['menu'], 'simple-icons': ['zoho'] }`.
688
+ *
689
+ * Merged with what the scan finds. Declared names that don't resolve **throw**
690
+ * (a config error); scanned names that don't resolve only **warn** (a source
691
+ * typo shouldn't kill the dev server).
692
+ */
693
+ include?: Parameters<typeof generateIconInclude>[0];
694
+ /**
695
+ * How `<Icon />` draws the glyph.
696
+ *
697
+ * `'inline'` (default) reads it from the `@iconify-json/*` collection and
698
+ * inlines the `<svg>` — no runtime request, no icon-integration peer.
699
+ * `'sprite'` emits `<use href="…/icons.svg#id">` instead, for pages served
700
+ * where the sprite is already on the origin.
701
+ *
702
+ * Note this is separate from `register`: whether astro-icon is registered for
703
+ * YOUR OWN `<Icon>` usage is a different question from how ours renders.
704
+ */
705
+ engine?: 'inline' | 'sprite';
706
+ /**
707
+ * Register the icon integration for you (default true). Set false when you
708
+ * already list `icon()` in `integrations` yourself — the scan, the sprite and
709
+ * the resolver still run either way.
710
+ */
711
+ register?: boolean;
712
+ /** Directories to scan, relative to the project root. Default `['src']`; `false` disables. */
713
+ scan?: string[] | false;
714
+ /** Public href of the sprite, for the `'sprite'` engine. Default `'/vitops/icons.svg'`. */
715
+ sprite?: string;
716
+ /** Aliases applied before the semantic map — legacy names, or values stored in CMS content. */
717
+ overrides?: Record<string, string>;
330
718
  }
331
719
  declare function getvitops(opts?: GetvitopsOptions): AstroIntegration;
332
720
  //#endregion
333
- export { type GetvitopsCssOptions, type GetvitopsFaviconOptions, type GetvitopsOptions, type GetvitopsSeoOptions, type GetvitopsSitemapChangeFreq, type GetvitopsSitemapEntry, type GetvitopsSitemapOptions, type ResolvedSeo, type SeoContext, type SeoNameTag, type SeoOgType, type SeoPropertyTag, type SeoProps, type SeoTwitterCard, getvitops as default, resolveSeo };
721
+ //#region src/lastmod.d.ts
722
+ interface GitLastmodOptions {
723
+ /** Directories to read history from (default `src/pages`, `src/content`, `src/data`). */
724
+ dirs?: string[];
725
+ /** Repository root (default `process.cwd()`). */
726
+ cwd?: string;
727
+ /** Called with a human-readable reason when no dates could be derived. */
728
+ onWarn?: (message: string) => void;
729
+ }
730
+ /**
731
+ * `src/pages/blog/index.astro` → `/blog`; `src/pages/index.astro` → `/`.
732
+ *
733
+ * Dynamic routes return `undefined`: one source file backs many URLs, and its
734
+ * commit date describes the template rather than any of them. Stamping every
735
+ * generated page with the template's date is exactly the "wrong date" case above.
736
+ */
737
+ declare function routeFromPage(file: string): string | undefined;
738
+ /** The slug a content entry is most likely published under. */
739
+ declare function slugFromContent(file: string): string | undefined;
740
+ /**
741
+ * Build a `serialize` function that stamps `lastmod` from git history.
742
+ *
743
+ * Resolution order per URL: an exact file-based route first, then a unique
744
+ * content slug. "Unique" is doing real work — a slug appearing in two collections
745
+ * is dropped rather than guessed at, since picking either one would be a coin
746
+ * flip presented as a fact.
747
+ */
748
+ declare function gitLastmod(options?: GitLastmodOptions): Promise<(item: GetvitopsSitemapEntry) => GetvitopsSitemapEntry>;
749
+ //#endregion
750
+ export { type AnalyticsStrategy, type ClarityOptions, type ConsentCategory, type GetvitopsAnalyticsOptions, type GetvitopsConsentOptions, type GetvitopsCssOptions, type GetvitopsFaviconOptions, type GetvitopsMediaOptions, type GetvitopsOptions, type GetvitopsSeoOptions, type GetvitopsSitemapChangeFreq, type GetvitopsSitemapEntry, type GetvitopsSitemapOptions, type GitLastmodOptions, type GoogleAnalyticsOptions, type MatomoOptions, type OptionalConsentCategory, type PlausibleOptions, type ResolveAnalyticsContext, type ResolvedAnalytics, type ResolvedSeo, type ResolvedTag, type SeoContext, type SeoNameTag, type SeoOgType, type SeoPropertyTag, type SeoProps, type SeoTwitterCard, consentCategories, getvitops as default, gitLastmod, resolveAnalytics, resolveSeo, routeFromPage, slugFromContent };
334
751
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/seo.ts","../src/integration.ts"],"mappings":";;;;;;;;;;;AAaA;;;;AAA0B;AAG1B;AAAA,KAHY,cAAA;;KAGA,SAAA;AAAS;AAYrB;;;;;;;;;AAZqB,UAYJ,mBAAA;EAmBf;EAjBA,QAAA;EAoBE;;;;;;EAbF,aAAA;EAmBuC;EAjBvC,YAAA;EAiBwE;EAfxE,kBAAA;EAmBE;EAjBF,MAAA;EAmBE;EAjBF,sBAAA;EAmBS;EAjBT,oBAAA;EACA,SAAA;IAqBuB,+CAnBrB,IAAA,GAAO,SAAA,EA2CO;IAzCd,M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