@fifthbell/brokaw 0.1.75 → 0.1.77

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 CHANGED
@@ -46,6 +46,10 @@ When enabled, the shared standard and 404 shells collect only performance and fi
46
46
  - `@fifthbell/brokaw/schemas/cronkite-manifest.schema.json` -> CLS manifest contract
47
47
  - `@fifthbell/brokaw/schemas/feed-renderable-input.schema.json` -> CMS-owned feed renderable input boundary
48
48
  - `@fifthbell/brokaw/schemas/redirect-input.schema.json` -> redirect page input: one active redirect intent (gaulatti/ariston#211)
49
+ - `@fifthbell/brokaw/schemas/robots-input.schema.json` -> robots.txt input: the site's rules and sitemap URLs (fifthbell/cronkite#156)
50
+ - `@fifthbell/brokaw/schemas/sitemap-input.schema.json` -> sitemap file input: story URLs with real lastmod (fifthbell/cronkite#155)
51
+ - `@fifthbell/brokaw/schemas/sitemap-index-input.schema.json` -> sitemap index input: the sitemap files with their lastmod (fifthbell/cronkite#155)
52
+ - `@fifthbell/brokaw/schemas/feed-input.schema.json` -> Atom feed input: the latest released stories of one language (fifthbell/cronkite#157)
49
53
  - `@fifthbell/brokaw/schemas/live-program-release-input.schema.json` -> generic live-program release input
50
54
  - `@fifthbell/brokaw/partial-deps.json` -> partial-to-layout dependency map
51
55
 
@@ -183,6 +183,38 @@ export declare const cronkiteManifest: {
183
183
  readonly inputSchema: "dist/schemas/redirect-input.schema.json";
184
184
  readonly contentType: "text/html; charset=utf-8";
185
185
  };
186
+ readonly robots: {
187
+ readonly template: {
188
+ readonly entry: "src/templates/layouts/robots.hbs";
189
+ readonly partials: [];
190
+ };
191
+ readonly inputSchema: "dist/schemas/robots-input.schema.json";
192
+ readonly contentType: "text/plain; charset=utf-8";
193
+ };
194
+ readonly sitemap: {
195
+ readonly template: {
196
+ readonly entry: "src/templates/layouts/sitemap.hbs";
197
+ readonly partials: [];
198
+ };
199
+ readonly inputSchema: "dist/schemas/sitemap-input.schema.json";
200
+ readonly contentType: "text/xml; charset=utf-8";
201
+ };
202
+ readonly 'sitemap-index': {
203
+ readonly template: {
204
+ readonly entry: "src/templates/layouts/sitemap-index.hbs";
205
+ readonly partials: [];
206
+ };
207
+ readonly inputSchema: "dist/schemas/sitemap-index-input.schema.json";
208
+ readonly contentType: "text/xml; charset=utf-8";
209
+ };
210
+ readonly feed: {
211
+ readonly template: {
212
+ readonly entry: "src/templates/layouts/feed.hbs";
213
+ readonly partials: [];
214
+ };
215
+ readonly inputSchema: "dist/schemas/feed-input.schema.json";
216
+ readonly contentType: "text/xml; charset=utf-8";
217
+ };
186
218
  readonly 'social-image': {
187
219
  readonly template: {
188
220
  readonly entry: "src/templates/templates/instagram-image.hbs";
@@ -214,11 +246,6 @@ export declare const cronkiteManifest: {
214
246
  readonly contentType: "text/html; charset=utf-8";
215
247
  readonly cacheControl: "public, max-age=0, must-revalidate";
216
248
  readonly variants: [SystemVariant, ...SystemVariant[]];
217
- }, {
218
- readonly renderable: "search-page";
219
- readonly contentType: "text/html; charset=utf-8";
220
- readonly cacheControl: "public, max-age=0, must-revalidate";
221
- readonly variants: [SystemVariant, ...SystemVariant[]];
222
249
  }, {
223
250
  readonly renderable: "media-page";
224
251
  readonly contentType: "text/html; charset=utf-8";
@@ -1,4 +1,3 @@
1
- import { searchCopyByLanguage } from './search-copy.js';
2
1
  import { version } from './version.js';
3
2
  import { mediathekSystemPage, systemDocument } from './system-pages.js';
4
3
  const pagePartials = [
@@ -86,24 +85,23 @@ const page = (layout, dependencies) => ({
86
85
  const localizedSystemCopy = {
87
86
  en: {
88
87
  notFound: ['Page Not Found', 'The page you are looking for does not exist.', 'Go to Homepage', 'Or explore our categories:'],
89
- search: ['Search', 'Search stories from Fifthbell.'],
90
88
  },
91
89
  es: {
92
90
  notFound: ['Página no encontrada', 'La página que buscas no existe.', 'Ir al inicio', 'O explora nuestras categorías:'],
93
- search: ['Buscar', 'Busca noticias de Fifthbell.'],
94
91
  },
95
92
  it: {
96
93
  notFound: ['Pagina non trovata', 'La pagina che stai cercando non esiste.', 'Vai alla home page', 'Oppure esplora le nostre categorie:'],
97
- search: ['Cerca', 'Cerca notizie Fifthbell.'],
98
94
  },
99
95
  };
100
- const systemVariants = (layout, segment, createExtra) => {
96
+ // The 404 page in each language: the only localized system page, since the CMS
97
+ // publishes search itself (fifthbell/brokaw#38).
98
+ const notFoundVariants = (createExtra) => {
101
99
  const variants = ['en', 'es', 'it'].map((language) => {
102
- const localizedSegment = language === 'en' ? `/${segment}` : `/${language}/${segment}`;
103
- const copy = localizedSystemCopy[language][layout === '404' ? 'notFound' : 'search'];
100
+ const localizedSegment = language === 'en' ? '/404' : `/${language}/404`;
101
+ const copy = localizedSystemCopy[language].notFound;
104
102
  return {
105
- key: language === 'en' ? `html/${segment}/index.html` : `html/${language}/${segment}/index.html`,
106
- document: systemDocument(layout, language, localizedSegment, copy[0], copy[1], createExtra(language)),
103
+ key: language === 'en' ? 'html/404/index.html' : `html/${language}/404/index.html`,
104
+ document: systemDocument('404', language, localizedSegment, copy[0], copy[1], createExtra(language)),
107
105
  };
108
106
  });
109
107
  return [variants[0], ...variants.slice(1)];
@@ -242,6 +240,34 @@ export const cronkiteManifest = {
242
240
  inputSchema: 'dist/schemas/redirect-input.schema.json',
243
241
  contentType: 'text/html; charset=utf-8',
244
242
  },
243
+ // robots.txt for the site (fifthbell/cronkite#156). Its input is the CMS's
244
+ // rule set, not a canonical document.
245
+ robots: {
246
+ template: { entry: 'src/templates/layouts/robots.hbs', partials: [] },
247
+ inputSchema: 'dist/schemas/robots-input.schema.json',
248
+ contentType: 'text/plain; charset=utf-8',
249
+ },
250
+ // The sitemap files of the site (fifthbell/cronkite#155): one file of URLs
251
+ // and the index of those files. Their input is the CMS's story set, not a
252
+ // canonical document.
253
+ sitemap: {
254
+ template: { entry: 'src/templates/layouts/sitemap.hbs', partials: [] },
255
+ inputSchema: 'dist/schemas/sitemap-input.schema.json',
256
+ contentType: 'text/xml; charset=utf-8',
257
+ },
258
+ 'sitemap-index': {
259
+ template: { entry: 'src/templates/layouts/sitemap-index.hbs', partials: [] },
260
+ inputSchema: 'dist/schemas/sitemap-index-input.schema.json',
261
+ contentType: 'text/xml; charset=utf-8',
262
+ },
263
+ // The Atom feed of the latest released stories of one language
264
+ // (fifthbell/cronkite#157). Its input is the CMS's list, not a canonical
265
+ // document. text/ is the manifest's rule for a text content type.
266
+ feed: {
267
+ template: { entry: 'src/templates/layouts/feed.hbs', partials: [] },
268
+ inputSchema: 'dist/schemas/feed-input.schema.json',
269
+ contentType: 'text/xml; charset=utf-8',
270
+ },
245
271
  'social-image': {
246
272
  template: { entry: 'src/templates/templates/instagram-image.hbs', partials: [] },
247
273
  inputSchema: 'dist/schemas/social-image-input.schema.json',
@@ -266,22 +292,19 @@ export const cronkiteManifest = {
266
292
  cacheControl: immutable,
267
293
  },
268
294
  },
295
+ // Pages Cronkite generates without a CMS publish request (the manifest
296
+ // contract's definition). Search is not one: the CMS publishes it as a
297
+ // real search-page renderable (fifthbell/brokaw#38).
269
298
  systemPages: [
270
299
  {
271
300
  renderable: '404',
272
301
  contentType: 'text/html; charset=utf-8',
273
302
  cacheControl: 'public, max-age=0, must-revalidate',
274
- variants: systemVariants('404', '404', (language) => ({
303
+ variants: notFoundVariants((language) => ({
275
304
  homeLinkLabel: localizedSystemCopy[language].notFound[2],
276
305
  categoriesLabel: localizedSystemCopy[language].notFound[3],
277
306
  })),
278
307
  },
279
- {
280
- renderable: 'search-page',
281
- contentType: 'text/html; charset=utf-8',
282
- cacheControl: 'public, max-age=0, must-revalidate',
283
- variants: systemVariants('search-page', 'search', (language) => ({ searchCopy: searchCopyByLanguage[language] })),
284
- },
285
308
  mediathekSystemPage,
286
309
  ],
287
310
  },
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@fifthbell/brokaw",
3
- "version": "0.1.75",
3
+ "version": "0.1.77",
4
4
  "templateRendering": {
5
5
  "contract": "cronkite.templates",
6
6
  "contractVersion": 1,
@@ -499,6 +499,38 @@
499
499
  "inputSchema": "dist/schemas/redirect-input.schema.json",
500
500
  "contentType": "text/html; charset=utf-8"
501
501
  },
502
+ "robots": {
503
+ "template": {
504
+ "entry": "src/templates/layouts/robots.hbs",
505
+ "partials": []
506
+ },
507
+ "inputSchema": "dist/schemas/robots-input.schema.json",
508
+ "contentType": "text/plain; charset=utf-8"
509
+ },
510
+ "sitemap": {
511
+ "template": {
512
+ "entry": "src/templates/layouts/sitemap.hbs",
513
+ "partials": []
514
+ },
515
+ "inputSchema": "dist/schemas/sitemap-input.schema.json",
516
+ "contentType": "text/xml; charset=utf-8"
517
+ },
518
+ "sitemap-index": {
519
+ "template": {
520
+ "entry": "src/templates/layouts/sitemap-index.hbs",
521
+ "partials": []
522
+ },
523
+ "inputSchema": "dist/schemas/sitemap-index-input.schema.json",
524
+ "contentType": "text/xml; charset=utf-8"
525
+ },
526
+ "feed": {
527
+ "template": {
528
+ "entry": "src/templates/layouts/feed.hbs",
529
+ "partials": []
530
+ },
531
+ "inputSchema": "dist/schemas/feed-input.schema.json",
532
+ "contentType": "text/xml; charset=utf-8"
533
+ },
502
534
  "social-image": {
503
535
  "template": {
504
536
  "entry": "src/templates/templates/instagram-image.hbs",
@@ -878,175 +910,6 @@
878
910
  }
879
911
  ]
880
912
  },
881
- {
882
- "renderable": "search-page",
883
- "contentType": "text/html; charset=utf-8",
884
- "cacheControl": "public, max-age=0, must-revalidate",
885
- "variants": [
886
- {
887
- "key": "html/search/index.html",
888
- "document": {
889
- "id": "system-search-page-en",
890
- "slug": "/search",
891
- "canonicalUrl": "https://fifthbell.com/search",
892
- "contentVersion": "2026-09-21T00:00:00.000Z",
893
- "publishedAt": "2026-09-21T00:00:00.000Z",
894
- "updatedAt": "2026-09-21T00:00:00.000Z",
895
- "status": "published",
896
- "title": "Search",
897
- "excerpt": "Search stories from Fifthbell.",
898
- "language": "en",
899
- "featured": false,
900
- "body": [],
901
- "layout": "search-page",
902
- "authors": [
903
- {
904
- "name": "Fifthbell Newsroom",
905
- "slug": "fifthbell-newsroom"
906
- }
907
- ],
908
- "categories": [],
909
- "navigation": {
910
- "categories": []
911
- },
912
- "logoLink": "/",
913
- "seo": {
914
- "metaTitle": "Search | fifthbell",
915
- "metaDescription": "Search stories from Fifthbell."
916
- },
917
- "searchCopy": {
918
- "eyebrow": "Search",
919
- "heading": "Find Stories Fast",
920
- "intro": "Search titles and excerpts across current-language coverage.",
921
- "placeholder": "Search stories...",
922
- "submit": "Search",
923
- "emptyPrompt": "Start typing to search in this language.",
924
- "emptyState": "No query yet.",
925
- "noResults": "No matches for",
926
- "tryAnother": "Try a different keyword.",
927
- "resultSingular": "result",
928
- "resultPlural": "results",
929
- "forQuery": "for",
930
- "page": "Page",
931
- "of": "of",
932
- "previous": "Previous",
933
- "next": "Next",
934
- "searching": "Searching...",
935
- "unavailable": "Search is temporarily unavailable.",
936
- "loadFailure": "We could not load the search index right now."
937
- }
938
- }
939
- },
940
- {
941
- "key": "html/es/search/index.html",
942
- "document": {
943
- "id": "system-search-page-es",
944
- "slug": "/es/search",
945
- "canonicalUrl": "https://fifthbell.com/es/search",
946
- "contentVersion": "2026-09-21T00:00:00.000Z",
947
- "publishedAt": "2026-09-21T00:00:00.000Z",
948
- "updatedAt": "2026-09-21T00:00:00.000Z",
949
- "status": "published",
950
- "title": "Buscar",
951
- "excerpt": "Busca noticias de Fifthbell.",
952
- "language": "es",
953
- "featured": false,
954
- "body": [],
955
- "layout": "search-page",
956
- "authors": [
957
- {
958
- "name": "Fifthbell Newsroom",
959
- "slug": "fifthbell-newsroom"
960
- }
961
- ],
962
- "categories": [],
963
- "navigation": {
964
- "categories": []
965
- },
966
- "logoLink": "/es",
967
- "seo": {
968
- "metaTitle": "Buscar | fifthbell",
969
- "metaDescription": "Busca noticias de Fifthbell."
970
- },
971
- "searchCopy": {
972
- "eyebrow": "Buscar",
973
- "heading": "Encuentra noticias rápido",
974
- "intro": "Busca títulos y resúmenes en la cobertura de este idioma.",
975
- "placeholder": "Buscar noticias...",
976
- "submit": "Buscar",
977
- "emptyPrompt": "Escribe para buscar en este idioma.",
978
- "emptyState": "Aún no has escrito una búsqueda.",
979
- "noResults": "No hay resultados para",
980
- "tryAnother": "Prueba con otra palabra clave.",
981
- "resultSingular": "resultado",
982
- "resultPlural": "resultados",
983
- "forQuery": "para",
984
- "page": "Página",
985
- "of": "de",
986
- "previous": "Anterior",
987
- "next": "Siguiente",
988
- "searching": "Buscando...",
989
- "unavailable": "La búsqueda no está disponible temporalmente.",
990
- "loadFailure": "No pudimos cargar el índice de búsqueda en este momento."
991
- }
992
- }
993
- },
994
- {
995
- "key": "html/it/search/index.html",
996
- "document": {
997
- "id": "system-search-page-it",
998
- "slug": "/it/search",
999
- "canonicalUrl": "https://fifthbell.com/it/search",
1000
- "contentVersion": "2026-09-21T00:00:00.000Z",
1001
- "publishedAt": "2026-09-21T00:00:00.000Z",
1002
- "updatedAt": "2026-09-21T00:00:00.000Z",
1003
- "status": "published",
1004
- "title": "Cerca",
1005
- "excerpt": "Cerca notizie Fifthbell.",
1006
- "language": "it",
1007
- "featured": false,
1008
- "body": [],
1009
- "layout": "search-page",
1010
- "authors": [
1011
- {
1012
- "name": "Fifthbell Newsroom",
1013
- "slug": "fifthbell-newsroom"
1014
- }
1015
- ],
1016
- "categories": [],
1017
- "navigation": {
1018
- "categories": []
1019
- },
1020
- "logoLink": "/it",
1021
- "seo": {
1022
- "metaTitle": "Cerca | fifthbell",
1023
- "metaDescription": "Cerca notizie Fifthbell."
1024
- },
1025
- "searchCopy": {
1026
- "eyebrow": "Cerca",
1027
- "heading": "Trova rapidamente le notizie",
1028
- "intro": "Cerca nei titoli e nei sommari della copertura in questa lingua.",
1029
- "placeholder": "Cerca notizie...",
1030
- "submit": "Cerca",
1031
- "emptyPrompt": "Scrivi per cercare in questa lingua.",
1032
- "emptyState": "Non hai ancora inserito una ricerca.",
1033
- "noResults": "Nessun risultato per",
1034
- "tryAnother": "Prova un'altra parola chiave.",
1035
- "resultSingular": "risultato",
1036
- "resultPlural": "risultati",
1037
- "forQuery": "per",
1038
- "page": "Pagina",
1039
- "of": "di",
1040
- "previous": "Precedente",
1041
- "next": "Successivo",
1042
- "searching": "Ricerca in corso...",
1043
- "unavailable": "La ricerca è temporaneamente non disponibile.",
1044
- "loadFailure": "Non è stato possibile caricare l’indice di ricerca."
1045
- }
1046
- }
1047
- }
1048
- ]
1049
- },
1050
913
  {
1051
914
  "renderable": "media-page",
1052
915
  "contentType": "text/html; charset=utf-8",
@@ -4,8 +4,8 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
6
6
  <title>Live Program | fifthbell</title>
7
- <script type="module" crossorigin src="./live-program.v0.1.75.js"></script>
8
- <link rel="stylesheet" crossorigin href="./live-program.v0.1.75.css">
7
+ <script type="module" crossorigin src="./live-program.v0.1.77.js"></script>
8
+ <link rel="stylesheet" crossorigin href="./live-program.v0.1.77.css">
9
9
  </head>
10
10
  <body>
11
11
  <div id="root"></div>
@@ -45,7 +45,7 @@
45
45
  ]
46
46
  },
47
47
  "package": "@fifthbell/brokaw",
48
- "bundleVersion": "0.1.75",
48
+ "bundleVersion": "0.1.77",
49
49
  "schemaVersion": 1,
50
50
  "statePath": "state",
51
51
  "eventsPath": "events",
@@ -390,16 +390,16 @@
390
390
  "key": "index.html",
391
391
  "contentType": "text/html; charset=utf-8",
392
392
  "bytes": 446,
393
- "sha256": "596f6dc940d4948170fb991d9a59668f84121478408cdfaf043c0b85832beda9"
393
+ "sha256": "4f7266c5cc0e2f928d43dcc2edda3c8cfa35ec9941a11d4ba635064826f352d8"
394
394
  },
395
395
  {
396
- "key": "live-program.v0.1.75.css",
396
+ "key": "live-program.v0.1.77.css",
397
397
  "contentType": "text/css; charset=utf-8",
398
398
  "bytes": 77876,
399
399
  "sha256": "1a2d8bafa07010ec5017874261af1a2c87191e5e93599051227beb904901a3d6"
400
400
  },
401
401
  {
402
- "key": "live-program.v0.1.75.js",
402
+ "key": "live-program.v0.1.77.js",
403
403
  "contentType": "application/javascript; charset=utf-8",
404
404
  "bytes": 296100,
405
405
  "sha256": "da30127b17e88c759d42aaffae75f438a6cfc880461e6625943c8728c0ca3f6b"
@@ -3,7 +3,7 @@ function assertSameOrderedValues(label, manifestValues, sourceValues) {
3
3
  throw new Error(`${label} drift: manifest=${JSON.stringify(manifestValues)} source=${JSON.stringify(sourceValues)}`);
4
4
  }
5
5
  }
6
- export const NON_PAGE_RENDERABLES = new Set(['redirect', 'social-image']);
6
+ export const NON_PAGE_RENDERABLES = new Set(['feed', 'redirect', 'robots', 'sitemap', 'sitemap-index', 'social-image']);
7
7
  export function assertManifestAlignment(manifest, sources) {
8
8
  const rendering = manifest.templateRendering;
9
9
  // Renderables whose input is not a canonical document have no page layout.
@@ -0,0 +1,60 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://fifthbell.com/schemas/feed-input-v1.schema.json",
4
+ "title": "Fifthbell Atom feed input",
5
+ "description": "The latest released stories of one language as the CMS sends them (fifthbell/cronkite#157): at most 50 entries, newest first as sent. The feed has one author, the publication's name. An entry's id is the story's canonical URL, so it changes if the story moves to another URL (accepted). summary and imageUrl are optional and never invented: an entry without them has no such element. Dates are RFC 3339 date-times with a time zone. Keys Brokaw does not know are ignored.",
6
+ "type": "object",
7
+ "required": ["status", "language", "title", "author", "homeUrl", "selfUrl", "updated", "entries"],
8
+ "properties": {
9
+ "id": { "type": "string" },
10
+ "slug": { "type": "string" },
11
+ "layout": { "const": "feed", "description": "Optional: the publish request names the renderable. When present it must be this renderable's name. A producer whose gateway validates any document that has a layout as a canonical document leaves it out." },
12
+ "status": { "const": "published" },
13
+ "language": { "type": "string", "pattern": "^[a-z]{2,3}(?:-[A-Za-z0-9]{1,8})*$" },
14
+ "contentVersion": { "type": "string" },
15
+ "title": { "$ref": "#/$defs/text" },
16
+ "subtitle": { "$ref": "#/$defs/text" },
17
+ "author": { "$ref": "#/$defs/text", "description": "The publication's name, written as the feed's one atom:author (RFC 4287 section 4.1.1 requires an author on the feed or on every entry). Required, so the feed is always valid Atom." },
18
+ "homeUrl": { "$ref": "#/$defs/url" },
19
+ "selfUrl": { "$ref": "#/$defs/url" },
20
+ "updated": { "$ref": "#/$defs/dateTime" },
21
+ "entries": {
22
+ "type": "array",
23
+ "maxItems": 50,
24
+ "items": {
25
+ "type": "object",
26
+ "required": ["id", "title", "url", "published", "updated"],
27
+ "properties": {
28
+ "id": { "$ref": "#/$defs/url" },
29
+ "title": { "$ref": "#/$defs/text" },
30
+ "url": { "$ref": "#/$defs/url" },
31
+ "published": { "$ref": "#/$defs/dateTime" },
32
+ "updated": { "$ref": "#/$defs/dateTime" },
33
+ "summary": { "type": "string", "maxLength": 5000, "pattern": "^[^\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f]*$" },
34
+ "imageUrl": { "$ref": "#/$defs/url" }
35
+ }
36
+ }
37
+ }
38
+ },
39
+ "$defs": {
40
+ "text": {
41
+ "description": "Non-empty text without control characters that XML does not allow.",
42
+ "type": "string",
43
+ "minLength": 1,
44
+ "maxLength": 1000,
45
+ "pattern": "^[^\\u0000-\\u0008\\u000b\\u000c\\u000e-\\u001f\\u007f]+$"
46
+ },
47
+ "url": {
48
+ "description": "An absolute https URL with no whitespace or control character, at most 2,048 characters.",
49
+ "type": "string",
50
+ "maxLength": 2048,
51
+ "pattern": "^https://[^\\s\\u0000-\\u001f\\u007f\\u2028\\u2029]+$"
52
+ },
53
+ "dateTime": {
54
+ "description": "An RFC 3339 date-time with a time zone.",
55
+ "type": "string",
56
+ "maxLength": 40,
57
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2})$"
58
+ }
59
+ }
60
+ }
@@ -0,0 +1,54 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://fifthbell.com/schemas/robots-input-v1.schema.json",
4
+ "title": "Fifthbell robots.txt input",
5
+ "description": "The rules of one site's robots.txt as the CMS sends them (fifthbell/cronkite#156). At least one rule is required, and every rule needs at least one Allow or Disallow line: a document with none, or a group with neither, is refused, because an empty group allows everything and a missing rule set must never render as allow-all. Every value is one line of plain text with no control characters, so no value can add a directive. Keys Brokaw does not know are ignored.",
6
+ "type": "object",
7
+ "required": ["status", "rules", "sitemaps"],
8
+ "properties": {
9
+ "id": { "type": "string" },
10
+ "slug": { "type": "string" },
11
+ "layout": { "const": "robots", "description": "Optional: the publish request names the renderable. When present it must be this renderable's name. A producer whose gateway validates any document that has a layout as a canonical document leaves it out." },
12
+ "status": { "const": "published" },
13
+ "language": { "type": "string" },
14
+ "contentVersion": { "type": "string" },
15
+ "rules": {
16
+ "type": "array",
17
+ "minItems": 1,
18
+ "maxItems": 100,
19
+ "items": {
20
+ "type": "object",
21
+ "required": ["userAgent"],
22
+ "anyOf": [
23
+ { "required": ["allow"], "properties": { "allow": { "type": "array", "minItems": 1 } } },
24
+ { "required": ["disallow"], "properties": { "disallow": { "type": "array", "minItems": 1 } } }
25
+ ],
26
+ "properties": {
27
+ "userAgent": { "$ref": "#/$defs/line" },
28
+ "allow": { "type": "array", "maxItems": 500, "items": { "$ref": "#/$defs/line" } },
29
+ "disallow": { "type": "array", "maxItems": 500, "items": { "$ref": "#/$defs/line" } }
30
+ }
31
+ }
32
+ },
33
+ "sitemaps": {
34
+ "type": "array",
35
+ "maxItems": 50,
36
+ "items": { "$ref": "#/$defs/sitemapUrl" }
37
+ }
38
+ },
39
+ "$defs": {
40
+ "line": {
41
+ "description": "One line of text: not empty, no line break and no other control character.",
42
+ "type": "string",
43
+ "minLength": 1,
44
+ "maxLength": 512,
45
+ "pattern": "^[^\\u0000-\\u001f\\u007f\\u2028\\u2029]+$"
46
+ },
47
+ "sitemapUrl": {
48
+ "description": "An absolute https URL with no whitespace or control character.",
49
+ "type": "string",
50
+ "maxLength": 2048,
51
+ "pattern": "^https://[^\\s\\u0000-\\u001f\\u007f\\u2028\\u2029]+$"
52
+ }
53
+ }
54
+ }
@@ -0,0 +1,66 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://fifthbell.com/schemas/sitemap-index-input-v1.schema.json",
4
+ "title": "Fifthbell sitemap index input",
5
+ "description": "The sitemap index as the CMS sends it (fifthbell/cronkite#155): the files that list the site's URLs, each with the time it last changed. At least one and at most 4,000 files: the most that can never pass the 50 MB uncompressed limit of one file, whatever the locs hold (the sitemaps.org limit is 50,000 files). Keys Brokaw does not know are ignored.",
6
+ "type": "object",
7
+ "required": [
8
+ "status",
9
+ "sitemaps"
10
+ ],
11
+ "properties": {
12
+ "id": {
13
+ "type": "string"
14
+ },
15
+ "slug": {
16
+ "type": "string"
17
+ },
18
+ "layout": {
19
+ "const": "sitemap-index",
20
+ "description": "Optional: the publish request names the renderable. When present it must be this renderable's name. A producer whose gateway validates any document that has a layout as a canonical document leaves it out."
21
+ },
22
+ "status": {
23
+ "const": "published"
24
+ },
25
+ "language": {
26
+ "type": "string"
27
+ },
28
+ "contentVersion": {
29
+ "type": "string"
30
+ },
31
+ "sitemaps": {
32
+ "type": "array",
33
+ "minItems": 1,
34
+ "maxItems": 4000,
35
+ "items": {
36
+ "type": "object",
37
+ "required": [
38
+ "loc",
39
+ "lastmod"
40
+ ],
41
+ "properties": {
42
+ "loc": {
43
+ "$ref": "#/$defs/url"
44
+ },
45
+ "lastmod": {
46
+ "$ref": "#/$defs/lastmod"
47
+ }
48
+ }
49
+ }
50
+ }
51
+ },
52
+ "$defs": {
53
+ "url": {
54
+ "description": "An absolute https URL with no whitespace or control character, at most 2,048 characters (the sitemaps.org limit).",
55
+ "type": "string",
56
+ "maxLength": 2048,
57
+ "pattern": "^https://[^\\s\\u0000-\\u001f\\u007f\\u2028\\u2029]+$"
58
+ },
59
+ "lastmod": {
60
+ "description": "A W3C date (YYYY-MM-DD) or date-time with a time zone.",
61
+ "type": "string",
62
+ "maxLength": 40,
63
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}(?:T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2}))?$"
64
+ }
65
+ }
66
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://fifthbell.com/schemas/sitemap-input-v1.schema.json",
4
+ "title": "Fifthbell sitemap input",
5
+ "description": "One sitemap file as the CMS sends it (fifthbell/cronkite#155): the story URLs of one month, or the site's pages. At least one entry and at most 4,000: the most that can never pass the sitemaps.org 50 MB (50,000,000 bytes) uncompressed limit, whatever the entries hold (a loc of 2,048 characters that Handlebars escapes to 6 bytes each, plus markup, is under 12,500 bytes an entry, and 4,000 of them are under 50,000,000). The sitemaps.org limit of 50,000 URLs is therefore not reachable in one file: the producer splits larger sets across files, and keeps the single host of every loc. Each loc is an absolute https URL and each lastmod the story's real updatedAt. Keys Brokaw does not know are ignored.",
6
+ "type": "object",
7
+ "required": ["status", "entries"],
8
+ "properties": {
9
+ "id": { "type": "string" },
10
+ "slug": { "type": "string" },
11
+ "layout": { "const": "sitemap", "description": "Optional: the publish request names the renderable. When present it must be this renderable's name. A producer whose gateway validates any document that has a layout as a canonical document leaves it out." },
12
+ "status": { "const": "published" },
13
+ "language": { "type": "string" },
14
+ "contentVersion": { "type": "string" },
15
+ "entries": {
16
+ "type": "array",
17
+ "minItems": 1,
18
+ "maxItems": 4000,
19
+ "items": {
20
+ "type": "object",
21
+ "required": ["loc", "lastmod"],
22
+ "properties": {
23
+ "loc": { "$ref": "#/$defs/url" },
24
+ "lastmod": { "$ref": "#/$defs/lastmod" },
25
+ "changefreq": { "enum": ["always", "hourly", "daily", "weekly", "monthly", "yearly", "never"] },
26
+ "priority": { "type": "number", "minimum": 0, "maximum": 1 }
27
+ }
28
+ }
29
+ }
30
+ },
31
+ "$defs": {
32
+ "url": {
33
+ "description": "An absolute https URL with no whitespace or control character, at most 2,048 characters (the sitemaps.org limit).",
34
+ "type": "string",
35
+ "maxLength": 2048,
36
+ "pattern": "^https://[^\\s\\u0000-\\u001f\\u007f\\u2028\\u2029]+$"
37
+ },
38
+ "lastmod": {
39
+ "description": "A W3C date (YYYY-MM-DD) or date-time with a time zone.",
40
+ "type": "string",
41
+ "maxLength": 40,
42
+ "pattern": "^\\d{4}-\\d{2}-\\d{2}(?:T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d+)?(?:Z|[+-]\\d{2}:\\d{2}))?$"
43
+ }
44
+ }
45
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@fifthbell/brokaw",
3
3
  "description": "Server-side Handlebars renderer and templates for fifthbell pages.",
4
- "version": "0.1.75",
4
+ "version": "0.1.77",
5
5
  "license": "MIT",
6
6
  "author": "fifthbell",
7
7
  "repository": {
@@ -41,6 +41,10 @@
41
41
  "./schemas/cronkite-manifest.schema.json": "./dist/schemas/cronkite-manifest.schema.json",
42
42
  "./schemas/feed-renderable-input.schema.json": "./dist/schemas/feed-renderable-input.schema.json",
43
43
  "./schemas/redirect-input.schema.json": "./dist/schemas/redirect-input.schema.json",
44
+ "./schemas/robots-input.schema.json": "./dist/schemas/robots-input.schema.json",
45
+ "./schemas/sitemap-index-input.schema.json": "./dist/schemas/sitemap-index-input.schema.json",
46
+ "./schemas/sitemap-input.schema.json": "./dist/schemas/sitemap-input.schema.json",
47
+ "./schemas/feed-input.schema.json": "./dist/schemas/feed-input.schema.json",
44
48
  "./schemas/live-program-release-input.schema.json": "./dist/schemas/live-program-release-input.schema.json",
45
49
  "./video": "./dist/video/index.js",
46
50
  "./components/live-program": {
@@ -0,0 +1,38 @@
1
+ {{!--
2
+ Atom 1.0 feed of the latest released stories of one language
3
+ (fifthbell/cronkite#157). Text is escaped as XML text: Handlebars turns & < >
4
+ and quotes into character references, which XML reads back as the same
5
+ characters. Nothing is invented: an entry without a summary or an image has no
6
+ such element. The feed's own id is its self URL; an entry's id is the story's
7
+ canonical URL, so it changes if the story moves (accepted). The feed carries one
8
+ author, the publication's name from the document (RFC 4287 section 4.1.1).
9
+ --}}
10
+ <?xml version="1.0" encoding="UTF-8"?>
11
+ <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{language}}">
12
+ <title>{{title}}</title>
13
+ {{#if subtitle}}
14
+ <subtitle>{{subtitle}}</subtitle>
15
+ {{/if}}
16
+ <link rel="alternate" type="text/html" href="{{homeUrl}}"/>
17
+ <link rel="self" type="application/atom+xml" href="{{selfUrl}}"/>
18
+ <id>{{selfUrl}}</id>
19
+ <updated>{{updated}}</updated>
20
+ <author>
21
+ <name>{{author}}</name>
22
+ </author>
23
+ {{#each entries}}
24
+ <entry>
25
+ <title>{{title}}</title>
26
+ <link rel="alternate" type="text/html" href="{{url}}"/>
27
+ <id>{{id}}</id>
28
+ <published>{{published}}</published>
29
+ <updated>{{updated}}</updated>
30
+ {{#if summary}}
31
+ <summary>{{summary}}</summary>
32
+ {{/if}}
33
+ {{#if imageUrl}}
34
+ <link rel="enclosure" href="{{imageUrl}}"/>
35
+ {{/if}}
36
+ </entry>
37
+ {{/each}}
38
+ </feed>
@@ -0,0 +1,22 @@
1
+ {{!--
2
+ robots.txt (fifthbell/cronkite#156). Plain text, no HTML escaping: every value is
3
+ a single line by the input schema (no control characters), so no value can add a
4
+ directive. One group per rule in the given order, Allow lines before Disallow
5
+ lines, then one Sitemap line per URL. The input schema requires at least one
6
+ rule and every rule at least one Allow or Disallow line, so a document with no
7
+ rules, or a group with neither, is refused instead of rendering an empty file
8
+ or group that would allow everything.
9
+ --}}
10
+ {{#each rules}}
11
+ User-agent: {{{userAgent}}}
12
+ {{#each allow}}
13
+ Allow: {{{this}}}
14
+ {{/each}}
15
+ {{#each disallow}}
16
+ Disallow: {{{this}}}
17
+ {{/each}}
18
+
19
+ {{/each}}
20
+ {{#each sitemaps}}
21
+ Sitemap: {{{this}}}
22
+ {{/each}}
@@ -0,0 +1,13 @@
1
+ {{!--
2
+ Sitemap index (fifthbell/cronkite#155): one <sitemap> per file, in the given
3
+ order. Text is escaped as for the sitemap file itself.
4
+ --}}
5
+ <?xml version="1.0" encoding="UTF-8"?>
6
+ <sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
7
+ {{#each sitemaps}}
8
+ <sitemap>
9
+ <loc>{{loc}}</loc>
10
+ <lastmod>{{lastmod}}</lastmod>
11
+ </sitemap>
12
+ {{/each}}
13
+ </sitemapindex>
@@ -0,0 +1,22 @@
1
+ {{!--
2
+ Sitemap file (fifthbell/cronkite#155): one <url> per entry, in the given order.
3
+ Values are XML text: Handlebars' escaping turns & < > and quotes into character
4
+ references, which XML reads back as the same characters, so a URL with & in it
5
+ stays valid. The input schema keeps each loc an absolute https URL without
6
+ whitespace or control characters and each lastmod a W3C date or date-time.
7
+ --}}
8
+ <?xml version="1.0" encoding="UTF-8"?>
9
+ <urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
10
+ {{#each entries}}
11
+ <url>
12
+ <loc>{{loc}}</loc>
13
+ <lastmod>{{lastmod}}</lastmod>
14
+ {{#if changefreq}}
15
+ <changefreq>{{changefreq}}</changefreq>
16
+ {{/if}}
17
+ {{#if priority includeZero=true}}
18
+ <priority>{{priority}}</priority>
19
+ {{/if}}
20
+ </url>
21
+ {{/each}}
22
+ </urlset>