@writedocs/generator 0.13.4 → 0.14.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/README.md +28 -28
- package/astro.config.mjs +645 -645
- package/bin/writedocs.js +359 -356
- package/package.json +99 -99
- package/src/cli/base-path-layout.js +44 -44
- package/src/cli/build-auth.js +135 -135
- package/src/cli/build.js +223 -203
- package/src/cli/check-built-styles.js +41 -41
- package/src/cli/convert.js +124 -124
- package/src/cli/dev.js +269 -268
- package/src/cli/exit-when-flushed.js +42 -42
- package/src/cli/generate-api-pages.js +509 -507
- package/src/cli/og-image-worker.js +20 -20
- package/src/cli/og-images.js +70 -70
- package/src/cli/page-list-watch.js +71 -69
- package/src/cli/run-astro.js +97 -97
- package/src/cli/run-pagefind.js +154 -154
- package/src/cli/write-mcp-files.js +103 -103
- package/src/cli/write-redirects-file.js +158 -158
- package/src/components/ApiReferencePanel.astro +1792 -1792
- package/src/components/AppIcon.astro +51 -51
- package/src/components/Card.astro +193 -193
- package/src/components/CodeGroup.astro +63 -39
- package/src/components/CopyPageMenu.astro +374 -374
- package/src/components/Hint.astro +188 -188
- package/src/components/Icon.astro +72 -72
- package/src/components/Image.astro +165 -165
- package/src/components/Tile.astro +67 -67
- package/src/components/Video.astro +137 -137
- package/src/content.config.ts +219 -203
- package/src/layout/BaseLayout.astro +908 -908
- package/src/layout/components/AnalyticsScripts.astro +49 -49
- package/src/layout/components/Breadcrumbs.astro +98 -98
- package/src/layout/components/ConsentBanner.astro +119 -119
- package/src/layout/components/MobileMenu.astro +225 -225
- package/src/layout/components/NavTree.astro +422 -408
- package/src/layout/components/Sidebar.astro +232 -232
- package/src/layout/components/SiteFooter.astro +87 -87
- package/src/layout/components/TopBar.astro +386 -386
- package/src/layout/styles/base.css +332 -326
- package/src/layout/styles/mobile-menu.css +285 -285
- package/src/lib/agent-markdown.js +164 -164
- package/src/lib/asset-dimensions.js +89 -89
- package/src/lib/base-path.js +90 -90
- package/src/lib/cli-report.js +22 -22
- package/src/lib/code-line-numbers.js +13 -0
- package/src/lib/config-schema.js +12 -1
- package/src/lib/config-schema.ts +2523 -2509
- package/src/lib/config.ts +1331 -1316
- package/src/lib/consent.js +108 -108
- package/src/lib/content-check.js +4 -1
- package/src/lib/content-store-reload-integration.js +101 -101
- package/src/lib/drafts.js +186 -0
- package/src/lib/icon-data-dev.js +53 -53
- package/src/lib/image-size.js +152 -152
- package/src/lib/json-schema-descriptions.js +228 -228
- package/src/lib/link-check.js +553 -544
- package/src/lib/llms-index.ts +90 -90
- package/src/lib/mcp-dev-integration.js +65 -65
- package/src/lib/mcp-index.ts +102 -102
- package/src/lib/mintlify-convert.js +605 -605
- package/src/lib/moved-api-pages.js +49 -49
- package/src/lib/og-cards.js +33 -33
- package/src/lib/og-image.js +235 -235
- package/src/lib/openapi-dev-status.js +80 -80
- package/src/lib/openapi-reload-integration.js +193 -193
- package/src/lib/pages.js +346 -312
- package/src/lib/project-files-integration.js +116 -116
- package/src/lib/project-files.js +137 -137
- package/src/lib/rehype-base-path.js +62 -62
- package/src/lib/rehype-image-loading.js +71 -71
- package/src/lib/robots-txt.js +21 -21
- package/src/lib/search-scope.js +44 -44
- package/src/lib/selector-placement.js +50 -50
- package/src/lib/seo-tags.js +157 -155
- package/src/lib/shiki-code-block.js +7 -1
- package/src/lib/site-base.ts +27 -27
- package/src/lib/styles-asset-integration.js +291 -291
- package/src/lib/wdignore-cases.json +195 -195
- package/src/lib/wdignore.js +177 -177
- package/src/pages/404.astro +63 -63
- package/src/pages/[...slug].astro +1773 -1608
- package/src/pages/[...slug].md.ts +93 -93
- package/src/pages/llms-full.txt.ts +88 -88
- package/src/pages/og/[...slug].png.ts +63 -63
- package/src/scripts/mobile-menu.ts +80 -80
- package/src/scripts/search.ts +245 -245
- package/src/scripts/sidebar-scroll.ts +61 -61
- package/src/styles/global.css +40 -40
package/src/content.config.ts
CHANGED
|
@@ -1,203 +1,219 @@
|
|
|
1
|
-
import { defineCollection } from 'astro:content';
|
|
2
|
-
import { glob } from 'astro/loaders';
|
|
3
|
-
import type { Loader } from 'astro/loaders';
|
|
4
|
-
import fs from 'node:fs';
|
|
5
|
-
import path from 'node:path';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
//
|
|
20
|
-
//
|
|
21
|
-
//
|
|
22
|
-
//
|
|
23
|
-
//
|
|
24
|
-
//
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
//
|
|
28
|
-
//
|
|
29
|
-
//
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
* directory doesn't exist
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
//
|
|
64
|
-
//
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
//
|
|
76
|
-
//
|
|
77
|
-
//
|
|
78
|
-
//
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
//
|
|
116
|
-
//
|
|
117
|
-
// frontmatter
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
141
|
-
*
|
|
142
|
-
*
|
|
143
|
-
*
|
|
144
|
-
*
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
},
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
watcher.
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
1
|
+
import { defineCollection } from 'astro:content';
|
|
2
|
+
import { glob } from 'astro/loaders';
|
|
3
|
+
import type { Loader } from 'astro/loaders';
|
|
4
|
+
import fs from 'node:fs';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import { createHash } from 'node:crypto';
|
|
7
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
8
|
+
import { pageFrontmatterSchema, findAllPages } from './lib/config';
|
|
9
|
+
import { titleFromPath } from './lib/pages.js';
|
|
10
|
+
import { writedocsTempDir } from './lib/writedocs-temp-dir.js';
|
|
11
|
+
|
|
12
|
+
const contentDir = process.env.WRITEDOCS_CONTENT_DIR || process.cwd();
|
|
13
|
+
|
|
14
|
+
// Astro's glob loader resolves `base` via `new URL(base, root)`. On Windows,
|
|
15
|
+
// a raw path string like "C:\foo\docs" gets misparsed by the WHATWG URL
|
|
16
|
+
// parser (the drive letter "C:" looks like a URL scheme), which breaks
|
|
17
|
+
// downstream `fileURLToPath` calls. Passing an explicit file:// URL sidesteps
|
|
18
|
+
// that entirely and works the same on every platform.
|
|
19
|
+
//
|
|
20
|
+
// Auto-generated OpenAPI stub pages (see generate-api-pages.js) live under
|
|
21
|
+
// writedocsTempDir() - an OS-temp-directory location keyed off contentDir,
|
|
22
|
+
// not anywhere inside the content directory itself - so they never show up
|
|
23
|
+
// mixed in with a site's own hand-written pages, and writedocs never writes
|
|
24
|
+
// generated files into a person's own project folder. The same location is
|
|
25
|
+
// also where build-time manifests/caches live - see writedocs-temp-dir.js's
|
|
26
|
+
// own doc comment. A separate collection (rather than a second base folder
|
|
27
|
+
// glued onto `pages` somehow) because Astro's loader API has no supported
|
|
28
|
+
// way to point one collection's glob() at two base directories sharing a
|
|
29
|
+
// single store without each call's own "delete anything I didn't just see"
|
|
30
|
+
// cleanup wiping out the other's entries - [...slug].astro merges both
|
|
31
|
+
// collections' entries back into one list at query time instead, which
|
|
32
|
+
// sidesteps that entirely.
|
|
33
|
+
const generatedDocsDir = path.join(writedocsTempDir(contentDir), 'generated-docs');
|
|
34
|
+
const generatedDocsBase = pathToFileURL(generatedDocsDir + path.sep);
|
|
35
|
+
|
|
36
|
+
// Page frontmatter - defined in lib/config-schema.ts as
|
|
37
|
+
// pageFrontmatterSchema, next to writedocs.json's own schema, so
|
|
38
|
+
// `writedocs validate` checks every page against exactly the schema the
|
|
39
|
+
// build uses (that file compiles to the plain JS validate loads).
|
|
40
|
+
const docsSchema = pageFrontmatterSchema;
|
|
41
|
+
|
|
42
|
+
/** Wraps another loader so it's skipped entirely - no filesystem scan, no
|
|
43
|
+
* "directory doesn't exist"/"no files found" warning - when its own base
|
|
44
|
+
* directory doesn't exist yet. Astro requires every collection declared
|
|
45
|
+
* in this file to have a loader, but most sites have no OpenAPI groups
|
|
46
|
+
* at all (generate-api-pages.js only ever creates a generated-docs/
|
|
47
|
+
* directory under writedocsTempDir() when at least one exists), so without this
|
|
48
|
+
* the `generatedDocs` collection below would print a spurious warning on
|
|
49
|
+
* every single build/dev run for the common case of a site with no
|
|
50
|
+
* OpenAPI pages.
|
|
51
|
+
*
|
|
52
|
+
* Without a watcher, in `writedocs dev` too: the collection is synced when
|
|
53
|
+
* the preview starts and then only when lib/openapi-reload-integration.js
|
|
54
|
+
* asks (refreshContent()), after writing the pages of an edited spec - in
|
|
55
|
+
* the order that keeps the navigation and the pages in step. A watcher of
|
|
56
|
+
* its own would sync each page file as it's written, at its own moment
|
|
57
|
+
* (and each refresh would add another set of its listeners). */
|
|
58
|
+
function skipIfMissing(inner: Loader): Loader {
|
|
59
|
+
return {
|
|
60
|
+
name: inner.name,
|
|
61
|
+
load: async (context) => {
|
|
62
|
+
if (!fs.existsSync(generatedDocsBase)) return;
|
|
63
|
+
// Left empty: the last spec taken out of writedocs.json while
|
|
64
|
+
// `writedocs dev` runs (the folder stays then). glob() would only warn
|
|
65
|
+
// about no files and keep the pages it had.
|
|
66
|
+
if (!fs.readdirSync(generatedDocsBase, { recursive: true }).some((file) => /\.mdx?$/i.test(String(file)))) {
|
|
67
|
+
for (const id of context.store.keys()) context.store.delete(id);
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
return inner.load({ ...withTitleFallback(context), watcher: undefined });
|
|
71
|
+
},
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
// A page with no `title` in its frontmatter gets one from its file name,
|
|
76
|
+
// before the schema (which requires `title`) sees it - Mintlify's rule, so
|
|
77
|
+
// a migrated page that relied on it builds with the same title. See
|
|
78
|
+
// titleFromPath() in lib/pages.js; `writedocs validate` applies the same
|
|
79
|
+
// default (lib/content-check.js).
|
|
80
|
+
//
|
|
81
|
+
// And each page's digest - what Astro's content store, kept between runs in
|
|
82
|
+
// writedocsTempDir()'s cache/, compares to reuse a page's data instead of
|
|
83
|
+
// parsing it again - also covers the frontmatter schema (config-schema.ts).
|
|
84
|
+
// With the file's text alone, a page that hadn't changed kept the data an
|
|
85
|
+
// earlier writedocs parsed: after an upgrade that added `draft`, a draft
|
|
86
|
+
// page came back without it - no strip in `writedocs dev`, and not noindex
|
|
87
|
+
// in `build --drafts`. Astro clears the store only when content.config.ts's
|
|
88
|
+
// own text, the Astro config or Astro's version changes.
|
|
89
|
+
const schemaDigest = createHash('sha256')
|
|
90
|
+
.update(fs.readFileSync(path.join(process.env.WRITEDOCS_PACKAGE_ROOT || process.cwd(), 'src', 'lib', 'config-schema.ts')))
|
|
91
|
+
.digest('hex')
|
|
92
|
+
.slice(0, 16);
|
|
93
|
+
|
|
94
|
+
type LoaderContext = Parameters<Loader['load']>[0];
|
|
95
|
+
function withTitleFallback(context: LoaderContext): LoaderContext {
|
|
96
|
+
return {
|
|
97
|
+
...context,
|
|
98
|
+
generateDigest: (data) => context.generateDigest(typeof data === 'string' ? `${schemaDigest}\n${data}` : data),
|
|
99
|
+
parseData: (props) =>
|
|
100
|
+
context.parseData({
|
|
101
|
+
...props,
|
|
102
|
+
data:
|
|
103
|
+
typeof props.data?.title === 'string'
|
|
104
|
+
? props.data
|
|
105
|
+
: { ...props.data, title: titleFromPath(props.filePath ?? props.id) },
|
|
106
|
+
}),
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
const generatedDocs = defineCollection({
|
|
111
|
+
loader: skipIfMissing(glob({ pattern: '**/*.{md,mdx}', base: generatedDocsBase })),
|
|
112
|
+
schema: docsSchema,
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// Every hand-written page in the project, wherever it lives - see
|
|
116
|
+
// findAllPages() in lib/config.ts for the exact discovery rule (any
|
|
117
|
+
// .md/.mdx file with a frontmatter block, the usual build/dependency
|
|
118
|
+
// directories excluded - docs/ has no special status, it's scanned like
|
|
119
|
+
// any other folder). A single collection covering the whole content
|
|
120
|
+
// directory works here (unlike generatedDocs, which needs its own
|
|
121
|
+
// separate collection - see that const's own comment) because there's
|
|
122
|
+
// only one base to worry about: the content root itself.
|
|
123
|
+
//
|
|
124
|
+
// The literal file list (rather than a `**/*.{md,mdx}` pattern) is what
|
|
125
|
+
// actually implements the frontmatter-based filter: glob()'s `pattern`
|
|
126
|
+
// option takes glob patterns, not a predicate function, so the predicate
|
|
127
|
+
// has to run first, here, to produce the list glob() then just matches
|
|
128
|
+
// literally. Astro's own default id computation, scoped to this same
|
|
129
|
+
// content-root base, is what gives a page under docs/ its "docs/..."
|
|
130
|
+
// file id and a page at the root its bare file id - see
|
|
131
|
+
// fileIdForEntry()'s own comment in lib/config.ts for the one place that
|
|
132
|
+
// id computation needs to be independently recovered (once a page's
|
|
133
|
+
// frontmatter `slug` has overridden `entry.id` itself).
|
|
134
|
+
const contentRootBase = pathToFileURL(contentDir + path.sep);
|
|
135
|
+
|
|
136
|
+
/** Wraps astro's own glob() loader so pages are re-discovered live during
|
|
137
|
+
* `astro dev`, not just once when this module first evaluates.
|
|
138
|
+
*
|
|
139
|
+
* The naive approach - `glob({ pattern: findAllPages(contentDir), base })`,
|
|
140
|
+
* computed once at module load, as this used to be - works fine for the
|
|
141
|
+
* *first* load, but astro's glob loader's own dev-mode watcher only ever
|
|
142
|
+
* matches entries against whatever literal pattern list it was constructed
|
|
143
|
+
* with (see matchesGlob() in astro's glob.js, called from its `watcher.on(
|
|
144
|
+
* 'add', ...)` handler): a file created after that list was computed can
|
|
145
|
+
* never match it, so it silently never becomes a page until the dev server
|
|
146
|
+
* is restarted and this module re-evaluates findAllPages() from scratch.
|
|
147
|
+
* That's the exact bug this wrapper fixes.
|
|
148
|
+
*
|
|
149
|
+
* A plain wildcard pattern (`**\/*.{md,mdx}`) doesn't work as a substitute,
|
|
150
|
+
* either: whether a given .md/.mdx file counts as a page at all depends on
|
|
151
|
+
* its *content* (does it have a frontmatter block? - see findAllPages()'s
|
|
152
|
+
* own doc comment, this is what lets e.g. snippets/ partials with no
|
|
153
|
+
* frontmatter coexist in the content dir without becoming pages
|
|
154
|
+
* themselves), not just its path, and glob()'s `pattern` option only does
|
|
155
|
+
* path matching - it can't express that filter. Something has to re-run
|
|
156
|
+
* findAllPages() itself, content and all, whenever the file set changes.
|
|
157
|
+
*
|
|
158
|
+
* So: this re-invokes astro's own glob() loader - reusing all of its real
|
|
159
|
+
* parsing/rendering/digest-based caching logic rather than reimplementing
|
|
160
|
+
* any of that - with a freshly recomputed literal file list every time
|
|
161
|
+
* something relevant changes on disk, instead of once. The inner loader's
|
|
162
|
+
* own watcher wiring is deliberately skipped each time (`watcher` is
|
|
163
|
+
* stripped from the context passed to it) - this loader keeps exactly one
|
|
164
|
+
* watcher subscription of its own instead, covering every case uniformly
|
|
165
|
+
* (a new page file appearing, one being deleted, frontmatter being added
|
|
166
|
+
* to or removed from an existing file, ordinary content edits) rather than
|
|
167
|
+
* relying on the inner loader's add/change/unlink handlers, which - as
|
|
168
|
+
* above - are only ever bound to whatever the pattern looked like at the
|
|
169
|
+
* moment they were registered. */
|
|
170
|
+
function livePages(dir: string, base: URL): Loader {
|
|
171
|
+
return {
|
|
172
|
+
name: 'writedocs-live-pages',
|
|
173
|
+
load: async (context) => {
|
|
174
|
+
const { watcher, store, logger } = context;
|
|
175
|
+
|
|
176
|
+
async function resync() {
|
|
177
|
+
const files = findAllPages(dir);
|
|
178
|
+
if (files.length === 0) {
|
|
179
|
+
// Mirrors the old skipIfEmpty() wrapper: skip calling the inner
|
|
180
|
+
// loader entirely (rather than passing it an empty/impossible
|
|
181
|
+
// pattern) so astro doesn't print its own "no files found"
|
|
182
|
+
// warning for a freshly-scaffolded project with no content yet -
|
|
183
|
+
// but still clear out any previously-synced entries, in case a
|
|
184
|
+
// page's last file was just deleted mid dev-session rather than
|
|
185
|
+
// this being the initial load of an empty project.
|
|
186
|
+
for (const id of store.keys()) store.delete(id);
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
await glob({ pattern: files, base }).load({ ...withTitleFallback(context), watcher: undefined });
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
await resync();
|
|
193
|
+
if (!watcher) return; // no watcher outside `astro dev` (e.g. `astro build`)
|
|
194
|
+
|
|
195
|
+
watcher.add(fileURLToPath(base));
|
|
196
|
+
let pending: ReturnType<typeof setTimeout> | undefined;
|
|
197
|
+
const scheduleResync = (changedPath: string) => {
|
|
198
|
+
if (!/\.mdx?$/i.test(changedPath)) return;
|
|
199
|
+
clearTimeout(pending);
|
|
200
|
+
// Debounced: an editor's "save" can fire several fs events in
|
|
201
|
+
// quick succession (e.g. atomic-write = unlink+add), and adding
|
|
202
|
+
// several files at once shouldn't trigger a resync per file.
|
|
203
|
+
pending = setTimeout(() => {
|
|
204
|
+
resync().catch((err) => logger.error(`Failed to reload pages: ${err.message}`));
|
|
205
|
+
}, 100);
|
|
206
|
+
};
|
|
207
|
+
watcher.on('add', scheduleResync);
|
|
208
|
+
watcher.on('unlink', scheduleResync);
|
|
209
|
+
watcher.on('change', scheduleResync);
|
|
210
|
+
},
|
|
211
|
+
};
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const pages = defineCollection({
|
|
215
|
+
loader: livePages(contentDir, contentRootBase),
|
|
216
|
+
schema: docsSchema,
|
|
217
|
+
});
|
|
218
|
+
|
|
219
|
+
export const collections = { pages, generatedDocs };
|