@escape-game-over/atlas 0.1.32 → 0.1.33

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@escape-game-over/atlas",
3
- "version": "0.1.32",
3
+ "version": "0.1.33",
4
4
  "type": "module",
5
5
  "description": "Typed, data-driven machinery for static multi-locale, multi-deployment Astro sites.",
6
6
  "private": false,
package/src/index.ts CHANGED
@@ -160,6 +160,7 @@ export {
160
160
  type ArticleContent,
161
161
  buildMeta,
162
162
  buildNotFoundMeta,
163
+ META_LENGTH_LIMITS,
163
164
  type MetaContent,
164
165
  type MetaTag,
165
166
  type OpenGraphType,
package/src/meta/index.ts CHANGED
@@ -57,7 +57,11 @@ export type {
57
57
  ThemeColor,
58
58
  } from "./content.ts";
59
59
  export type { RobotsDirective, RobotsPolicy } from "./robots.ts";
60
- export { resolveShareImage, type ShareImage } from "./share-image.ts";
60
+ export {
61
+ META_LENGTH_LIMITS,
62
+ resolveShareImage,
63
+ type ShareImage,
64
+ } from "./share-image.ts";
61
65
  export type { MetaTag } from "./tag.ts";
62
66
  export type { SiteVerification } from "./verification.ts";
63
67
 
@@ -109,8 +109,11 @@ const NO_PREVIEW_BELOW = 200;
109
109
  * the tightest is the one that counts. Facebook's mobile preview is that: a line
110
110
  * under it survives everywhere, while a line written to Google's 160 is already
111
111
  * clipped in a share. A title is cut far sooner, by the surface people search on.
112
+ *
113
+ * Exported so a site that picks between copy variants fits them to these
114
+ * numbers rather than a copy of them.
112
115
  */
113
- const LENGTH_LIMITS = {
116
+ export const META_LENGTH_LIMITS = {
114
117
  title: {
115
118
  limit: 60,
116
119
  why: "a search result cuts a title around there, and the end of it is usually the part that identifies the page",
@@ -128,11 +131,11 @@ const LENGTH_LIMITS = {
128
131
  * nobody notices without being told.
129
132
  */
130
133
  export function warnIfClipped(
131
- field: keyof typeof LENGTH_LIMITS,
134
+ field: keyof typeof META_LENGTH_LIMITS,
132
135
  value: string,
133
136
  at: string
134
137
  ): void {
135
- const { limit, why } = LENGTH_LIMITS[field];
138
+ const { limit, why } = META_LENGTH_LIMITS[field];
136
139
  if (value.length <= limit) return;
137
140
 
138
141
  warn(at, `${field} is ${value.length} characters, past ~${limit}: ${why}.`);