@autobusal/routes-order 1.37.6 → 1.37.7

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.
@@ -36,9 +36,27 @@ interface Props {
36
36
  * is a single parse for a consumer and a single tag in the snapshot;
37
37
  * scattering them would multiply the boilerplate by the number of coaches.
38
38
  */
39
+ const TRIPS = 100;
40
+
39
41
  const Schema = ({ data, t }: Props): (JSX.Element | null) => {
40
42
  const stop = (name: string) => ({ '@type': 'BusStop', name });
41
43
 
44
+ /**
45
+ * HOW MANY DEPARTURES GET MARKUP, which is not the same as how many the
46
+ * page shows.
47
+ *
48
+ * Edited: Claude - Date: 2026-09-16
49
+ *
50
+ * MEASURED on a busy pair (Tirana-Thessaloniki, ten coaches a day): thirty
51
+ * days produced 300 BusTrip nodes and 194 KB of JSON-LD - 41% of a 482 KB
52
+ * page, for a hundred near-identical descriptions of the same two-hour
53
+ * journey at different clock times. The table underneath still lists every
54
+ * one of the thirty days in plain text, so nothing is hidden from a reader
55
+ * or from a crawler; what is capped is the repetition in the markup.
56
+ *
57
+ * A hundred is roughly a fortnight on the busiest pair here and the whole
58
+ * month on most of them, which is the horizon anybody books within.
59
+ */
42
60
  const trips = data.days.flatMap(day => day.departures.map(row => ({
43
61
  '@type': 'BusTrip',
44
62
  name: t('routes_order.facts.title', { from: data.from, to: data.to }),
@@ -103,7 +121,7 @@ const Schema = ({ data, t }: Props): (JSX.Element | null) => {
103
121
  return null;
104
122
  }
105
123
 
106
- return <JsonLd data={ { '@context': 'https://schema.org', '@graph': trips } } />;
124
+ return <JsonLd data={ { '@context': 'https://schema.org', '@graph': trips.slice(0, TRIPS) } } />;
107
125
  };
108
126
 
109
127
  export default Schema;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@autobusal/routes-order",
3
- "version": "1.37.6",
3
+ "version": "1.37.7",
4
4
  "author": "Ferjolt Ozuni",
5
5
  "type": "module",
6
6
  "main": "index.ts",