@jxsuite/feed 0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Kevin Shenk
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/dist/feed.js ADDED
@@ -0,0 +1,465 @@
1
+ // ../../packages/schema/src/locale.ts
2
+ var RTL_SCRIPTS = new Set([
3
+ "Adlm",
4
+ "Arab",
5
+ "Aran",
6
+ "Armi",
7
+ "Avst",
8
+ "Cprt",
9
+ "Egyd",
10
+ "Egyh",
11
+ "Elym",
12
+ "Gara",
13
+ "Hatr",
14
+ "Hebr",
15
+ "Hluw",
16
+ "Hung",
17
+ "Khar",
18
+ "Lydi",
19
+ "Mand",
20
+ "Mani",
21
+ "Mend",
22
+ "Merc",
23
+ "Mero",
24
+ "Narb",
25
+ "Nbat",
26
+ "Nkoo",
27
+ "Orkh",
28
+ "Palm",
29
+ "Phli",
30
+ "Phlp",
31
+ "Phnx",
32
+ "Prti",
33
+ "Rohg",
34
+ "Samr",
35
+ "Sarb",
36
+ "Sogd",
37
+ "Sogo",
38
+ "Syrc",
39
+ "Thaa",
40
+ "Todr",
41
+ "Yezi"
42
+ ]);
43
+ function canonicalizeLocale(tag) {
44
+ if (typeof tag !== "string" || tag.trim() === "") {
45
+ return null;
46
+ }
47
+ try {
48
+ return new Intl.Locale(tag.trim()).toString();
49
+ } catch {
50
+ return null;
51
+ }
52
+ }
53
+ var DEFAULT_ROUTING = "prefix-except-default";
54
+ function resolveI18n(projectConfig) {
55
+ const raw = projectConfig.i18n;
56
+ const errors = [];
57
+ if (!raw || typeof raw !== "object") {
58
+ return { errors, i18n: null };
59
+ }
60
+ const declared = Array.isArray(raw.locales) ? raw.locales : [];
61
+ const locales = [];
62
+ for (const tag of declared) {
63
+ const canonical = canonicalizeLocale(tag);
64
+ if (canonical === null) {
65
+ errors.push(`i18n.locales: "${String(tag)}" is not a well-formed BCP 47 language tag.`);
66
+ continue;
67
+ }
68
+ if (!locales.includes(canonical)) {
69
+ locales.push(canonical);
70
+ }
71
+ }
72
+ const defaultLocale = canonicalizeLocale(raw.defaultLocale) ?? locales[0] ?? null;
73
+ if (raw.defaultLocale !== undefined && canonicalizeLocale(raw.defaultLocale) === null) {
74
+ errors.push(`i18n.defaultLocale: "${String(raw.defaultLocale)}" is not a well-formed BCP 47 language tag.`);
75
+ }
76
+ if (defaultLocale === null) {
77
+ errors.push("i18n is declared with no usable locale — set `defaultLocale` or `locales`.");
78
+ return { errors, i18n: null };
79
+ }
80
+ if (!locales.includes(defaultLocale)) {
81
+ locales.unshift(defaultLocale);
82
+ }
83
+ const routing = raw.routing === "prefix-always" || raw.routing === "prefix-except-default" ? raw.routing : DEFAULT_ROUTING;
84
+ return { errors, i18n: { defaultLocale, locales, routing } };
85
+ }
86
+ function localeUrlPrefix(locale, i18n) {
87
+ if (i18n === null) {
88
+ return "";
89
+ }
90
+ const canonical = canonicalizeLocale(locale);
91
+ if (canonical === null || !i18n.locales.includes(canonical)) {
92
+ return "";
93
+ }
94
+ if (canonical === i18n.defaultLocale && i18n.routing === "prefix-except-default") {
95
+ return "";
96
+ }
97
+ return `/${canonical.toLowerCase()}`;
98
+ }
99
+
100
+ // src/shared.ts
101
+ var DEFAULTS = {
102
+ archive: false,
103
+ contentMode: "summary",
104
+ dateField: "date",
105
+ description: "",
106
+ formats: ["atom", "json"],
107
+ output: "/feed",
108
+ pageSize: 20,
109
+ title: "",
110
+ updatedField: "updated"
111
+ };
112
+ function normalizeFeedConfig(section, siteLanguage) {
113
+ const out = {};
114
+ if (!section || typeof section !== "object") {
115
+ return out;
116
+ }
117
+ for (const [key, raw] of Object.entries(section)) {
118
+ if (!raw || typeof raw !== "object") {
119
+ continue;
120
+ }
121
+ const cfg = raw;
122
+ out[key] = {
123
+ archive: cfg.archive ?? DEFAULTS.archive,
124
+ author: cfg.author ?? null,
125
+ basePath: normalizeBasePath(cfg.basePath ?? "/"),
126
+ collection: cfg.collection ?? key,
127
+ contentMode: cfg.contentMode ?? DEFAULTS.contentMode,
128
+ dateField: cfg.dateField ?? DEFAULTS.dateField,
129
+ description: cfg.description ?? DEFAULTS.description,
130
+ formats: cfg.formats ?? [...DEFAULTS.formats],
131
+ language: cfg.language ?? siteLanguage ?? null,
132
+ output: cfg.output ?? DEFAULTS.output,
133
+ pageSize: cfg.pageSize ?? DEFAULTS.pageSize,
134
+ title: cfg.title ?? DEFAULTS.title,
135
+ updatedField: cfg.updatedField ?? DEFAULTS.updatedField
136
+ };
137
+ }
138
+ return out;
139
+ }
140
+ function normalizeBasePath(p) {
141
+ const withSlash = p.startsWith("/") ? p : `/${p}`;
142
+ return withSlash.endsWith("/") ? withSlash : `${withSlash}/`;
143
+ }
144
+ function entryUrl(siteUrl, basePath, id, trailingSlash) {
145
+ const path = trailingSlash === "never" ? `${basePath}${id}` : `${basePath}${id}/`;
146
+ return new URL(path, siteUrl).href;
147
+ }
148
+ function readDate(value) {
149
+ if (typeof value !== "string" || value === "") {
150
+ return null;
151
+ }
152
+ if (/^\d{4}-\d{2}-\d{2}$/.test(value)) {
153
+ return `${value}T00:00:00Z`;
154
+ }
155
+ return /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d+)?([Zz]|[+-]\d{2}:\d{2})$/.test(value) ? value : null;
156
+ }
157
+ function entryToItem(entry, feed, siteUrl, trailingSlash) {
158
+ const data = entry.data ?? {};
159
+ const meta = entry._meta ?? {};
160
+ const url = entryUrl(siteUrl, feed.basePath, entry.id, trailingSlash);
161
+ const published = readDate(data[feed.dateField]) ?? readDate(meta.mtime);
162
+ const { author } = data;
163
+ return {
164
+ authorName: typeof author === "string" ? author : author?.name ?? feed.author?.name ?? null,
165
+ contentHtml: feed.contentMode === "full" ? String(entry.body ?? "") : null,
166
+ id: url,
167
+ published,
168
+ summary: typeof data.description === "string" ? data.description : typeof meta.excerpt === "string" ? meta.excerpt : "",
169
+ title: typeof data.title === "string" ? data.title : entry.id,
170
+ updated: readDate(data[feed.updatedField]) ?? published,
171
+ url
172
+ };
173
+ }
174
+ function sortItems(items) {
175
+ return [...items].toSorted((a, b) => {
176
+ if (a.published === b.published) {
177
+ return a.id < b.id ? -1 : a.id > b.id ? 1 : 0;
178
+ }
179
+ if (a.published === null) {
180
+ return 1;
181
+ }
182
+ if (b.published === null) {
183
+ return -1;
184
+ }
185
+ return a.published < b.published ? 1 : -1;
186
+ });
187
+ }
188
+ function feedUpdated(items) {
189
+ let newest = null;
190
+ for (const item of items) {
191
+ const stamp = item.updated ?? item.published;
192
+ if (stamp !== null && (newest === null || stamp > newest)) {
193
+ newest = stamp;
194
+ }
195
+ }
196
+ return newest;
197
+ }
198
+ function paginate(items, pageSize) {
199
+ if (items.length <= pageSize) {
200
+ return { archives: [], current: [...items] };
201
+ }
202
+ const current = items.slice(0, pageSize);
203
+ const oldestFirst = items.slice(pageSize).toReversed();
204
+ const archives = [];
205
+ for (let i = 0;i < oldestFirst.length; i += pageSize) {
206
+ archives.push(oldestFirst.slice(i, i + pageSize).toReversed());
207
+ }
208
+ return { archives, current };
209
+ }
210
+ function escapeXml(value) {
211
+ return value.replaceAll("&", "&amp;").replaceAll("<", "&lt;").replaceAll(">", "&gt;").replaceAll('"', "&quot;").replaceAll("'", "&apos;");
212
+ }
213
+ function feedPath(output, ext, archiveIndex) {
214
+ const base = output.startsWith("/") ? output : `/${output}`;
215
+ return archiveIndex === undefined ? `${base}.${ext}` : `${base}/archive/${archiveIndex + 1}.${ext}`;
216
+ }
217
+
218
+ // src/atom.ts
219
+ var ATOM_NS = "http://www.w3.org/2005/Atom";
220
+ var HISTORY_NS = "http://purl.org/syndication/history/1.0";
221
+ function tag(name, value, indent = " ") {
222
+ return value === null || value === undefined || value === "" ? "" : `${indent}<${name}>${escapeXml(value)}</${name}>
223
+ `;
224
+ }
225
+ function link(rel, href, type) {
226
+ const t = type === undefined ? "" : ` type="${type}"`;
227
+ return ` <link rel="${rel}" href="${escapeXml(href)}"${t}/>
228
+ `;
229
+ }
230
+ function renderEntry(item) {
231
+ const inner = " ";
232
+ const author = item.authorName === null ? "" : `${inner}<author>
233
+ ${inner} <name>${escapeXml(item.authorName)}</name>
234
+ ${inner}</author>
235
+ `;
236
+ return [
237
+ ` <entry>
238
+ `,
239
+ tag("id", item.id, inner),
240
+ tag("title", item.title, inner),
241
+ `${inner}<link rel="alternate" href="${escapeXml(item.url)}"/>
242
+ `,
243
+ tag("updated", item.updated ?? item.published, inner),
244
+ tag("published", item.published, inner),
245
+ author,
246
+ tag("summary", item.summary, inner),
247
+ item.contentHtml === null ? "" : `${inner}<content type="html">${escapeXml(item.contentHtml)}</content>
248
+ `,
249
+ ` </entry>
250
+ `
251
+ ].join("");
252
+ }
253
+ function renderAtom(page) {
254
+ const { feed, items, siteUrl } = page;
255
+ const ns = page.complete ? ` xmlns:fh="${HISTORY_NS}"` : "";
256
+ const lang = feed.language === null ? "" : ` xml:lang="${escapeXml(feed.language)}"`;
257
+ const head = [
258
+ `<?xml version="1.0" encoding="utf-8"?>
259
+ `,
260
+ `<feed xmlns="${ATOM_NS}"${ns}${lang}>
261
+ `,
262
+ tag("id", page.selfUrl),
263
+ tag("title", feed.title === "" ? "Feed" : feed.title),
264
+ tag("subtitle", feed.description),
265
+ tag("updated", page.updated ?? "1970-01-01T00:00:00Z"),
266
+ link("self", page.selfUrl, "application/atom+xml"),
267
+ link("alternate", new URL(feed.basePath, siteUrl).href, "text/html"),
268
+ page.currentUrl === undefined ? "" : link("current", page.currentUrl, "application/atom+xml"),
269
+ page.prevArchiveUrl === undefined ? "" : link("prev-archive", page.prevArchiveUrl, "application/atom+xml"),
270
+ page.nextArchiveUrl === undefined ? "" : link("next-archive", page.nextArchiveUrl, "application/atom+xml"),
271
+ page.complete === true ? ` <fh:complete/>
272
+ ` : "",
273
+ feed.author?.name === undefined ? "" : ` <author>
274
+ <name>${escapeXml(feed.author.name)}</name>
275
+ ${feed.author.uri === undefined ? "" : ` <uri>${escapeXml(feed.author.uri)}</uri>
276
+ `}${feed.author.email === undefined ? "" : ` <email>${escapeXml(feed.author.email)}</email>
277
+ `} </author>
278
+ `
279
+ ];
280
+ return `${head.join("")}${items.map((i) => renderEntry(i)).join("")}</feed>
281
+ `;
282
+ }
283
+ function atomUrl(siteUrl, output, archiveIndex) {
284
+ return new URL(feedPath(output, "xml", archiveIndex), siteUrl).href;
285
+ }
286
+
287
+ // src/json-feed.ts
288
+ var VERSION = "https://jsonfeed.org/version/1.1";
289
+ function renderJsonFeed(page) {
290
+ const { feed, items, siteUrl } = page;
291
+ const doc = {
292
+ description: feed.description === "" ? undefined : feed.description,
293
+ feed_url: page.selfUrl,
294
+ home_page_url: new URL(feed.basePath, siteUrl).href,
295
+ language: feed.language ?? undefined,
296
+ next_url: page.nextUrl,
297
+ title: feed.title === "" ? "Feed" : feed.title,
298
+ version: VERSION,
299
+ ...feed.author?.name === undefined ? {} : { authors: [{ name: feed.author.name }] },
300
+ items: items.map((item) => {
301
+ const out = { id: item.id, title: item.title, url: item.url };
302
+ if (item.contentHtml !== null) {
303
+ out.content_html = item.contentHtml;
304
+ } else {
305
+ out.content_text = item.summary;
306
+ }
307
+ if (item.summary !== "") {
308
+ out.summary = item.summary;
309
+ }
310
+ if (item.published !== null) {
311
+ out.date_published = item.published;
312
+ }
313
+ if (item.updated !== null && item.updated !== item.published) {
314
+ out.date_modified = item.updated;
315
+ }
316
+ if (item.authorName !== null) {
317
+ out.authors = [{ name: item.authorName }];
318
+ }
319
+ return out;
320
+ })
321
+ };
322
+ return `${JSON.stringify(doc, null, 2)}
323
+ `;
324
+ }
325
+ function jsonFeedUrl(siteUrl, output, archiveIndex) {
326
+ return new URL(feedPath(output, "json", archiveIndex), siteUrl).href;
327
+ }
328
+
329
+ // src/feed.ts
330
+ var MEDIA_TYPES = { atom: "application/atom+xml", json: "application/feed+json" };
331
+ function siteUrlOf(projectConfig) {
332
+ const url = projectConfig?.url;
333
+ return typeof url === "string" && url !== "" ? url : null;
334
+ }
335
+ function feedLocales(projectConfig, collection) {
336
+ const { i18n } = resolveI18n(projectConfig ?? {});
337
+ const content = projectConfig?.content;
338
+ const source = content?.[collection]?.source;
339
+ const localized = typeof source === "string" && source.includes("{locale}");
340
+ return { i18n, locales: i18n !== null && localized ? i18n.locales : [] };
341
+ }
342
+ function localeVariant(feed, locale, i18n) {
343
+ const prefix = localeUrlPrefix(locale, i18n);
344
+ return {
345
+ ...feed,
346
+ basePath: `${prefix}${feed.basePath}`,
347
+ language: locale,
348
+ output: `${prefix}${feed.output}`
349
+ };
350
+ }
351
+ var Feed = {
352
+ projectData(sectionValue, ctx) {
353
+ return normalizeFeedConfig(sectionValue, ctx?.projectConfig?.defaults?.lang);
354
+ },
355
+ head(sectionValue, ctx) {
356
+ const siteUrl = siteUrlOf(ctx.projectConfig);
357
+ if (siteUrl === null) {
358
+ return [];
359
+ }
360
+ const config = normalizeFeedConfig(sectionValue, ctx.projectConfig?.defaults?.lang);
361
+ const entries = [];
362
+ for (const feed of Object.values(config)) {
363
+ const { i18n, locales } = feedLocales(ctx.projectConfig, feed.collection);
364
+ const published = locales.length > 0 ? locales.map((l) => localeVariant(feed, l, i18n)) : [feed];
365
+ for (const variant of published) {
366
+ for (const format of variant.formats) {
367
+ const href = format === "atom" ? atomUrl(siteUrl, variant.output) : jsonFeedUrl(siteUrl, variant.output);
368
+ entries.push({
369
+ attributes: {
370
+ href,
371
+ ...variant.language !== null && locales.length > 0 ? { hreflang: variant.language } : {},
372
+ rel: "alternate",
373
+ title: variant.title === "" ? "Feed" : variant.title,
374
+ type: MEDIA_TYPES[format]
375
+ },
376
+ tagName: "link"
377
+ });
378
+ }
379
+ }
380
+ }
381
+ return entries;
382
+ },
383
+ emit(sectionValue, ctx) {
384
+ const siteUrl = siteUrlOf(ctx.projectConfig);
385
+ if (siteUrl === null) {
386
+ console.warn("@jxsuite/feed: `url` is not set in project.json — feeds need absolute links.");
387
+ return [];
388
+ }
389
+ const config = normalizeFeedConfig(sectionValue, ctx.projectConfig?.defaults?.lang);
390
+ const content = ctx.sections?.content;
391
+ const trailingSlash = String(ctx.projectConfig?.build?.trailingSlash ?? "always");
392
+ const files = [];
393
+ for (const [key, feed] of Object.entries(config)) {
394
+ const entries = content?.get(feed.collection);
395
+ if (!entries) {
396
+ console.warn(`@jxsuite/feed: feed "${key}" names collection "${feed.collection}", which is not a ` + "loaded content collection — skipped");
397
+ continue;
398
+ }
399
+ const { i18n, locales } = feedLocales(ctx.projectConfig, feed.collection);
400
+ if (locales.length === 0) {
401
+ files.push(...renderFeed(feed, entries, siteUrl, trailingSlash));
402
+ continue;
403
+ }
404
+ for (const locale of locales) {
405
+ const own = entries.filter((e) => canonicalizeLocale(e._meta?.locale) === locale);
406
+ if (own.length > 0) {
407
+ files.push(...renderFeed(localeVariant(feed, locale, i18n), own, siteUrl, trailingSlash));
408
+ }
409
+ }
410
+ }
411
+ return files;
412
+ }
413
+ };
414
+ function renderFeed(feed, entries, siteUrl, trailingSlash) {
415
+ const items = sortItems(entries.map((e) => entryToItem(e, feed, siteUrl, trailingSlash)));
416
+ const files = [];
417
+ const { archives, current } = feed.archive ? paginate(items, feed.pageSize) : { archives: [], current: items.slice(0, feed.pageSize) };
418
+ const complete = archives.length === 0 && current.length === items.length;
419
+ for (const format of feed.formats) {
420
+ const url = format === "atom" ? atomUrl : jsonFeedUrl;
421
+ if (format === "atom") {
422
+ files.push({
423
+ content: renderAtom({
424
+ complete,
425
+ feed,
426
+ items: current,
427
+ selfUrl: url(siteUrl, feed.output),
428
+ siteUrl,
429
+ updated: feedUpdated(items),
430
+ ...archives.length > 0 ? { prevArchiveUrl: url(siteUrl, feed.output, archives.length - 1) } : {}
431
+ }),
432
+ path: feedPath(feed.output, "xml")
433
+ });
434
+ for (const [i, page] of archives.entries()) {
435
+ files.push({
436
+ content: renderAtom({
437
+ currentUrl: url(siteUrl, feed.output),
438
+ feed,
439
+ items: page,
440
+ selfUrl: url(siteUrl, feed.output, i),
441
+ siteUrl,
442
+ updated: feedUpdated(page),
443
+ ...i > 0 ? { prevArchiveUrl: url(siteUrl, feed.output, i - 1) } : {},
444
+ nextArchiveUrl: i < archives.length - 1 ? url(siteUrl, feed.output, i + 1) : url(siteUrl, feed.output)
445
+ }),
446
+ path: feedPath(feed.output, "xml", i)
447
+ });
448
+ }
449
+ } else {
450
+ files.push({
451
+ content: renderJsonFeed({
452
+ feed,
453
+ items: current,
454
+ selfUrl: url(siteUrl, feed.output),
455
+ siteUrl
456
+ }),
457
+ path: feedPath(feed.output, "json")
458
+ });
459
+ }
460
+ }
461
+ return files;
462
+ }
463
+ export {
464
+ Feed
465
+ };
@@ -0,0 +1,7 @@
1
+ {
2
+ "name": "@jxsuite/feed",
3
+ "title": "Feeds",
4
+ "description": "Atom (RFC 4287) and JSON Feed generation from content collections, with RFC 5005 archives and automatic <link rel=\"alternate\"> discovery",
5
+ "classes": { "Feed": "./src/Feed.class.json" },
6
+ "schemas": { "project": "./schemas/project.fragment.schema.json" }
7
+ }
package/package.json ADDED
@@ -0,0 +1,44 @@
1
+ {
2
+ "name": "@jxsuite/feed",
3
+ "version": "0.1.0",
4
+ "description": "Syndication feeds for Jx: Atom (RFC 4287) and JSON Feed emitted from content collections at build time",
5
+ "license": "MIT",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "git+https://github.com/jxsuite/jx.git",
9
+ "directory": "extensions/feed"
10
+ },
11
+ "files": [
12
+ "src/",
13
+ "dist",
14
+ "jx-extension.json",
15
+ "schemas/"
16
+ ],
17
+ "type": "module",
18
+ "exports": {
19
+ ".": "./src/feed.ts",
20
+ "./atom": "./src/atom.ts",
21
+ "./json-feed": "./src/json-feed.ts",
22
+ "./shared": "./src/shared.ts",
23
+ "./jx-extension.json": "./jx-extension.json",
24
+ "./schemas/project.fragment.schema.json": "./schemas/project.fragment.schema.json",
25
+ "./Feed.class.json": "./src/Feed.class.json"
26
+ },
27
+ "publishConfig": {
28
+ "provenance": false
29
+ },
30
+ "scripts": {
31
+ "prepare": "bun build src/feed.ts --outdir=dist --format=esm --target=node",
32
+ "build": "bun run prepare",
33
+ "test": "bun test --isolate",
34
+ "test:coverage": "bun test --isolate --coverage",
35
+ "upgrade": "bunx npm-check-updates -u && bun install"
36
+ },
37
+ "dependencies": {
38
+ "@jxsuite/schema": "workspace:^"
39
+ },
40
+ "devDependencies": {
41
+ "ajv": "^8.20.0"
42
+ },
43
+ "jx": "./jx-extension.json"
44
+ }
@@ -0,0 +1,65 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://jxsuite.com/schema/extensions/feed/v1",
4
+ "title": "@jxsuite/feed project section",
5
+ "type": "object",
6
+ "properties": {
7
+ "feed": {
8
+ "type": "object",
9
+ "description": "Syndication feeds generated from content collections (@jxsuite/feed)",
10
+ "minProperties": 1,
11
+ "additionalProperties": {
12
+ "type": "object",
13
+ "required": ["collection", "basePath"],
14
+ "additionalProperties": false,
15
+ "properties": {
16
+ "collection": {
17
+ "type": "string",
18
+ "description": "The content collection this feed syndicates"
19
+ },
20
+ "basePath": {
21
+ "type": "string",
22
+ "pattern": "^/",
23
+ "description": "URL prefix the collection's entries are served under, e.g. \"/blog/\""
24
+ },
25
+ "title": { "type": "string" },
26
+ "description": { "type": "string" },
27
+ "formats": {
28
+ "type": "array",
29
+ "items": { "enum": ["atom", "json"] },
30
+ "default": ["atom", "json"],
31
+ "description": "RSS 2.0 is deliberately not offered: it has no standards body and every reader handles Atom."
32
+ },
33
+ "output": {
34
+ "type": "string",
35
+ "pattern": "^/",
36
+ "default": "/feed",
37
+ "description": "Base path; .xml and .json are appended"
38
+ },
39
+ "pageSize": { "type": "integer", "minimum": 1, "default": 20 },
40
+ "archive": {
41
+ "type": "boolean",
42
+ "default": false,
43
+ "description": "Emit RFC 5005 archived feeds for entries beyond pageSize"
44
+ },
45
+ "author": {
46
+ "type": "object",
47
+ "additionalProperties": false,
48
+ "properties": {
49
+ "name": { "type": "string" },
50
+ "uri": { "type": "string" },
51
+ "email": { "type": "string" }
52
+ }
53
+ },
54
+ "dateField": { "type": "string", "default": "date" },
55
+ "updatedField": { "type": "string", "default": "updated" },
56
+ "contentMode": { "enum": ["full", "summary", "none"], "default": "summary" },
57
+ "language": {
58
+ "type": "string",
59
+ "description": "BCP 47 language tag; defaults to defaults.lang"
60
+ }
61
+ }
62
+ }
63
+ }
64
+ }
65
+ }