@scalemule/news-publication 0.0.18 → 0.0.20
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/dist/index.cjs +35 -7
- package/dist/index.d.cts +24 -13
- package/dist/index.d.ts +24 -13
- package/dist/index.js +34 -8
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -82,7 +82,7 @@ var walnutCreekTimes = definePublication({
|
|
|
82
82
|
regionLabel: "Walnut Creek",
|
|
83
83
|
towns: ["Walnut Creek", "Rossmoor", "Saranap", "Pleasant Hill"],
|
|
84
84
|
nearbyTowns: ["Martinez", "Concord", "Contra Costa"],
|
|
85
|
-
sections: ["Civic life", "Community", "Local businesses", "
|
|
85
|
+
sections: ["Civic life", "Community", "Local businesses", "Real Estate", "Food & places", "Events", "Health"],
|
|
86
86
|
description: "Local news, independent businesses and community voices from Walnut Creek, Rossmoor, Saranap and Pleasant Hill.",
|
|
87
87
|
layout: "broadsheet",
|
|
88
88
|
layouts: ["broadsheet"],
|
|
@@ -174,9 +174,30 @@ function defaultRevalidateTargets() {
|
|
|
174
174
|
|
|
175
175
|
// src/editorial.ts
|
|
176
176
|
var labels = {
|
|
177
|
-
"Local businesses": "
|
|
177
|
+
"Local businesses": "Business",
|
|
178
|
+
"Events": "Things to do",
|
|
178
179
|
"Food & places": "Food & drink"
|
|
179
180
|
};
|
|
181
|
+
var EDITORIAL_SECTION_ORDER = [
|
|
182
|
+
"Civic life",
|
|
183
|
+
"Community",
|
|
184
|
+
"Local businesses",
|
|
185
|
+
"Real Estate",
|
|
186
|
+
"Food & places",
|
|
187
|
+
"Events",
|
|
188
|
+
"Health",
|
|
189
|
+
"Schools",
|
|
190
|
+
"Opinion"
|
|
191
|
+
];
|
|
192
|
+
function orderedSections(sections, order = EDITORIAL_SECTION_ORDER) {
|
|
193
|
+
return sections.filter((section) => section.name !== "Local news").slice().sort((left, right) => {
|
|
194
|
+
const leftRank = order.indexOf(left.name);
|
|
195
|
+
const rightRank = order.indexOf(right.name);
|
|
196
|
+
const leftOrder = leftRank === -1 ? order.length : leftRank;
|
|
197
|
+
const rightOrder = rightRank === -1 ? order.length : rightRank;
|
|
198
|
+
return leftOrder - rightOrder || left.name.localeCompare(right.name);
|
|
199
|
+
});
|
|
200
|
+
}
|
|
180
201
|
function sectionId(name) {
|
|
181
202
|
return "section-" + name.normalize("NFKD").replace(/\p{Mark}/gu, "").toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu, "-").replace(/^-|-$/g, "");
|
|
182
203
|
}
|
|
@@ -320,11 +341,16 @@ function newsArticleJsonLd(publication, article, canonical, authorName) {
|
|
|
320
341
|
headline: article.title,
|
|
321
342
|
description: article.excerpt ?? void 0,
|
|
322
343
|
datePublished: article.published_at,
|
|
323
|
-
|
|
344
|
+
// updated_at also changes for media/operational maintenance. A trusted
|
|
345
|
+
// editorial modification timestamp is required before emitting dateModified.
|
|
324
346
|
image: image ? [image] : void 0,
|
|
325
|
-
mainEntityOfPage:
|
|
347
|
+
mainEntityOfPage: url,
|
|
326
348
|
url,
|
|
327
|
-
|
|
349
|
+
...canonicalUrl !== url ? { isBasedOn: canonicalUrl } : {},
|
|
350
|
+
articleSection: article.section || void 0,
|
|
351
|
+
// The publication byline is known to be an organization. Do not infer a
|
|
352
|
+
// person's identity or classify an untyped external byline as a newsroom.
|
|
353
|
+
author: { ...!authorName || authorName === publication.name ? { "@type": "Organization" } : {}, name: authorName || publication.name },
|
|
328
354
|
publisher: { "@type": "NewsMediaOrganization", name: publication.name, url: canonical }
|
|
329
355
|
};
|
|
330
356
|
}
|
|
@@ -359,17 +385,17 @@ function articleMeta(publication, article, canonical, indexable) {
|
|
|
359
385
|
const canonicalUrl = publicHttps(article.canonical_url) ?? url;
|
|
360
386
|
const image = publicHttps(article.og_image_url) ?? publicHttps(article.cover_image_url);
|
|
361
387
|
return {
|
|
362
|
-
title: article.
|
|
388
|
+
title: article.title,
|
|
363
389
|
description: article.seo_description ?? article.excerpt ?? publication.description,
|
|
364
390
|
canonical: canonicalUrl,
|
|
365
391
|
indexable: indexable && !article.no_index,
|
|
366
392
|
openGraph: {
|
|
367
393
|
type: "article",
|
|
394
|
+
siteName: publication.name,
|
|
368
395
|
title: article.title,
|
|
369
396
|
description: article.excerpt ?? void 0,
|
|
370
397
|
url,
|
|
371
398
|
publishedTime: article.published_at,
|
|
372
|
-
modifiedTime: article.updated_at,
|
|
373
399
|
images: image ? [image] : []
|
|
374
400
|
}
|
|
375
401
|
};
|
|
@@ -1902,6 +1928,7 @@ exports.CLASSIFIED_CATEGORIES = CLASSIFIED_CATEGORIES;
|
|
|
1902
1928
|
exports.COOKIE_CATEGORIES = COOKIE_CATEGORIES;
|
|
1903
1929
|
exports.CookieConsentBanner = CookieConsentBanner;
|
|
1904
1930
|
exports.CookieSettingsView = CookieSettingsView;
|
|
1931
|
+
exports.EDITORIAL_SECTION_ORDER = EDITORIAL_SECTION_ORDER;
|
|
1905
1932
|
exports.EVENTS = EVENTS;
|
|
1906
1933
|
exports.FEATURE_NAMES = FEATURE_NAMES;
|
|
1907
1934
|
exports.JOB_EMPLOYMENT_TYPES = JOB_EMPLOYMENT_TYPES;
|
|
@@ -1969,6 +1996,7 @@ exports.matchesStoryTag = matchesStoryTag;
|
|
|
1969
1996
|
exports.nearbyUpdates = nearbyUpdates;
|
|
1970
1997
|
exports.newsArticleJsonLd = newsArticleJsonLd;
|
|
1971
1998
|
exports.normalizedText = normalizedText;
|
|
1999
|
+
exports.orderedSections = orderedSections;
|
|
1972
2000
|
exports.parseSnapshot = parseSnapshot;
|
|
1973
2001
|
exports.prepareClassified = prepareClassified;
|
|
1974
2002
|
exports.prepareJobPost = prepareJobPost;
|
package/dist/index.d.cts
CHANGED
|
@@ -102,6 +102,16 @@ declare function defaultRevalidateTargets(): {
|
|
|
102
102
|
paths: string[];
|
|
103
103
|
};
|
|
104
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Canonical reader-facing order for editorial sections across the network.
|
|
107
|
+
* Names not listed here sort after these, alphabetically. "Schools" and
|
|
108
|
+
* "Opinion" are reserved so future sections slot in without a release.
|
|
109
|
+
*/
|
|
110
|
+
declare const EDITORIAL_SECTION_ORDER: readonly ["Civic life", "Community", "Local businesses", "Real Estate", "Food & places", "Events", "Health", "Schools", "Opinion"];
|
|
111
|
+
/** Sorts sections into the canonical order, dropping the implicit "Local news" bucket. */
|
|
112
|
+
declare function orderedSections<T extends {
|
|
113
|
+
name: string;
|
|
114
|
+
}>(sections: T[], order?: readonly string[]): T[];
|
|
105
115
|
declare function sectionId(name: string): string;
|
|
106
116
|
declare function sectionPath(name: string): string;
|
|
107
117
|
declare function sectionDefinition(name: string): EditorialSection;
|
|
@@ -146,26 +156,27 @@ declare function storyDate(value: string): string | null;
|
|
|
146
156
|
/** https URL with no userinfo. Anything else is dropped from public markup. */
|
|
147
157
|
declare function publicHttps(value?: string | null): string | undefined;
|
|
148
158
|
declare function articleUrl(canonical: string, slug: string): string;
|
|
149
|
-
/**
|
|
159
|
+
/** Describe the local edition while retaining the designated reporting source. */
|
|
150
160
|
declare function newsArticleJsonLd(publication: NewsPublication, article: NewsArticle, canonical: string, authorName?: string | null): {
|
|
151
|
-
|
|
152
|
-
"@type": string;
|
|
153
|
-
headline: string;
|
|
154
|
-
description: string | undefined;
|
|
155
|
-
datePublished: string;
|
|
156
|
-
dateModified: string;
|
|
157
|
-
image: string[] | undefined;
|
|
158
|
-
mainEntityOfPage: string;
|
|
159
|
-
url: string;
|
|
161
|
+
articleSection: string | undefined;
|
|
160
162
|
author: {
|
|
161
|
-
"@type": string;
|
|
162
163
|
name: string;
|
|
164
|
+
"@type"?: string | undefined;
|
|
163
165
|
};
|
|
164
166
|
publisher: {
|
|
165
167
|
"@type": string;
|
|
166
168
|
name: string;
|
|
167
169
|
url: string;
|
|
168
170
|
};
|
|
171
|
+
isBasedOn?: string | undefined;
|
|
172
|
+
"@context": string;
|
|
173
|
+
"@type": string;
|
|
174
|
+
headline: string;
|
|
175
|
+
description: string | undefined;
|
|
176
|
+
datePublished: string;
|
|
177
|
+
image: string[] | undefined;
|
|
178
|
+
mainEntityOfPage: string;
|
|
179
|
+
url: string;
|
|
169
180
|
};
|
|
170
181
|
declare function publicationJsonLd(publication: NewsPublication, canonical: string): {
|
|
171
182
|
"@context": string;
|
|
@@ -199,11 +210,11 @@ declare function articleMeta(publication: NewsPublication, article: NewsArticle,
|
|
|
199
210
|
indexable: boolean;
|
|
200
211
|
openGraph: {
|
|
201
212
|
type: "article";
|
|
213
|
+
siteName: string;
|
|
202
214
|
title: string;
|
|
203
215
|
description: string | undefined;
|
|
204
216
|
url: string;
|
|
205
217
|
publishedTime: string;
|
|
206
|
-
modifiedTime: string;
|
|
207
218
|
images: string[];
|
|
208
219
|
};
|
|
209
220
|
};
|
|
@@ -300,4 +311,4 @@ declare function readerSources(input: unknown): {
|
|
|
300
311
|
publisher?: string;
|
|
301
312
|
}[];
|
|
302
313
|
|
|
303
|
-
export { ANALYTICS_COOKIE, ANALYTICS_VERSION, ArticleProvenance, type Attribution, BROADSHEET_THEME, COOKIE_CATEGORIES, CouponOffer, EVENTS, EditorialSection, type EffectiveTheme, FeatureName, HomepageSelection, LAYOUT_COOKIE, NEWS_CACHE, NearbyUpdate, NewsArticle, NewsError, NewsItem, NewsPublication, PublicationInput, PublicationTheme, SESSION_IDLE_MS, THEME_COOKIE, THEME_EVENT, THEME_MAX_AGE_SECONDS, THEME_STORAGE_KEY, type ThemeMode, UTM_FIELDS, UUID, activeNearby, applyTheme, articleCacheKey, articleCacheOptions, articleMeta, articleUrl, attribution, briefSummary, clearTheme, composeEdition, defaultRevalidateTargets, definePublication, displayHeadline, edgeCacheControl, editorialSections, featureEnabled, feedCacheKey, feedCacheOptions, filterNews, getStoredTheme, getSystemTheme, inventoryCacheOptions, llmsText, matchesStoryTag, nearbyUpdates, newsArticleJsonLd, normalizedText, publicHttps, publicUrl, publicationJsonLd, publicationMeta, readerSources, recordConsentToCompliance, referralCode, resolveCoupon, resolveEffectiveTheme, resolveLayout, revalidateDecision, secretsMatch, sectionDefinition, sectionId, sectionPath, setTheme, shortDeck, shortText, shouldServeLastKnown, storyDate, storyTowns, subscribeTheme, themeInitScript, townSlug, validCalendarDate, walnutCreekTimes, withLastKnown };
|
|
314
|
+
export { ANALYTICS_COOKIE, ANALYTICS_VERSION, ArticleProvenance, type Attribution, BROADSHEET_THEME, COOKIE_CATEGORIES, CouponOffer, EDITORIAL_SECTION_ORDER, EVENTS, EditorialSection, type EffectiveTheme, FeatureName, HomepageSelection, LAYOUT_COOKIE, NEWS_CACHE, NearbyUpdate, NewsArticle, NewsError, NewsItem, NewsPublication, PublicationInput, PublicationTheme, SESSION_IDLE_MS, THEME_COOKIE, THEME_EVENT, THEME_MAX_AGE_SECONDS, THEME_STORAGE_KEY, type ThemeMode, UTM_FIELDS, UUID, activeNearby, applyTheme, articleCacheKey, articleCacheOptions, articleMeta, articleUrl, attribution, briefSummary, clearTheme, composeEdition, defaultRevalidateTargets, definePublication, displayHeadline, edgeCacheControl, editorialSections, featureEnabled, feedCacheKey, feedCacheOptions, filterNews, getStoredTheme, getSystemTheme, inventoryCacheOptions, llmsText, matchesStoryTag, nearbyUpdates, newsArticleJsonLd, normalizedText, orderedSections, publicHttps, publicUrl, publicationJsonLd, publicationMeta, readerSources, recordConsentToCompliance, referralCode, resolveCoupon, resolveEffectiveTheme, resolveLayout, revalidateDecision, secretsMatch, sectionDefinition, sectionId, sectionPath, setTheme, shortDeck, shortText, shouldServeLastKnown, storyDate, storyTowns, subscribeTheme, themeInitScript, townSlug, validCalendarDate, walnutCreekTimes, withLastKnown };
|
package/dist/index.d.ts
CHANGED
|
@@ -102,6 +102,16 @@ declare function defaultRevalidateTargets(): {
|
|
|
102
102
|
paths: string[];
|
|
103
103
|
};
|
|
104
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Canonical reader-facing order for editorial sections across the network.
|
|
107
|
+
* Names not listed here sort after these, alphabetically. "Schools" and
|
|
108
|
+
* "Opinion" are reserved so future sections slot in without a release.
|
|
109
|
+
*/
|
|
110
|
+
declare const EDITORIAL_SECTION_ORDER: readonly ["Civic life", "Community", "Local businesses", "Real Estate", "Food & places", "Events", "Health", "Schools", "Opinion"];
|
|
111
|
+
/** Sorts sections into the canonical order, dropping the implicit "Local news" bucket. */
|
|
112
|
+
declare function orderedSections<T extends {
|
|
113
|
+
name: string;
|
|
114
|
+
}>(sections: T[], order?: readonly string[]): T[];
|
|
105
115
|
declare function sectionId(name: string): string;
|
|
106
116
|
declare function sectionPath(name: string): string;
|
|
107
117
|
declare function sectionDefinition(name: string): EditorialSection;
|
|
@@ -146,26 +156,27 @@ declare function storyDate(value: string): string | null;
|
|
|
146
156
|
/** https URL with no userinfo. Anything else is dropped from public markup. */
|
|
147
157
|
declare function publicHttps(value?: string | null): string | undefined;
|
|
148
158
|
declare function articleUrl(canonical: string, slug: string): string;
|
|
149
|
-
/**
|
|
159
|
+
/** Describe the local edition while retaining the designated reporting source. */
|
|
150
160
|
declare function newsArticleJsonLd(publication: NewsPublication, article: NewsArticle, canonical: string, authorName?: string | null): {
|
|
151
|
-
|
|
152
|
-
"@type": string;
|
|
153
|
-
headline: string;
|
|
154
|
-
description: string | undefined;
|
|
155
|
-
datePublished: string;
|
|
156
|
-
dateModified: string;
|
|
157
|
-
image: string[] | undefined;
|
|
158
|
-
mainEntityOfPage: string;
|
|
159
|
-
url: string;
|
|
161
|
+
articleSection: string | undefined;
|
|
160
162
|
author: {
|
|
161
|
-
"@type": string;
|
|
162
163
|
name: string;
|
|
164
|
+
"@type"?: string | undefined;
|
|
163
165
|
};
|
|
164
166
|
publisher: {
|
|
165
167
|
"@type": string;
|
|
166
168
|
name: string;
|
|
167
169
|
url: string;
|
|
168
170
|
};
|
|
171
|
+
isBasedOn?: string | undefined;
|
|
172
|
+
"@context": string;
|
|
173
|
+
"@type": string;
|
|
174
|
+
headline: string;
|
|
175
|
+
description: string | undefined;
|
|
176
|
+
datePublished: string;
|
|
177
|
+
image: string[] | undefined;
|
|
178
|
+
mainEntityOfPage: string;
|
|
179
|
+
url: string;
|
|
169
180
|
};
|
|
170
181
|
declare function publicationJsonLd(publication: NewsPublication, canonical: string): {
|
|
171
182
|
"@context": string;
|
|
@@ -199,11 +210,11 @@ declare function articleMeta(publication: NewsPublication, article: NewsArticle,
|
|
|
199
210
|
indexable: boolean;
|
|
200
211
|
openGraph: {
|
|
201
212
|
type: "article";
|
|
213
|
+
siteName: string;
|
|
202
214
|
title: string;
|
|
203
215
|
description: string | undefined;
|
|
204
216
|
url: string;
|
|
205
217
|
publishedTime: string;
|
|
206
|
-
modifiedTime: string;
|
|
207
218
|
images: string[];
|
|
208
219
|
};
|
|
209
220
|
};
|
|
@@ -300,4 +311,4 @@ declare function readerSources(input: unknown): {
|
|
|
300
311
|
publisher?: string;
|
|
301
312
|
}[];
|
|
302
313
|
|
|
303
|
-
export { ANALYTICS_COOKIE, ANALYTICS_VERSION, ArticleProvenance, type Attribution, BROADSHEET_THEME, COOKIE_CATEGORIES, CouponOffer, EVENTS, EditorialSection, type EffectiveTheme, FeatureName, HomepageSelection, LAYOUT_COOKIE, NEWS_CACHE, NearbyUpdate, NewsArticle, NewsError, NewsItem, NewsPublication, PublicationInput, PublicationTheme, SESSION_IDLE_MS, THEME_COOKIE, THEME_EVENT, THEME_MAX_AGE_SECONDS, THEME_STORAGE_KEY, type ThemeMode, UTM_FIELDS, UUID, activeNearby, applyTheme, articleCacheKey, articleCacheOptions, articleMeta, articleUrl, attribution, briefSummary, clearTheme, composeEdition, defaultRevalidateTargets, definePublication, displayHeadline, edgeCacheControl, editorialSections, featureEnabled, feedCacheKey, feedCacheOptions, filterNews, getStoredTheme, getSystemTheme, inventoryCacheOptions, llmsText, matchesStoryTag, nearbyUpdates, newsArticleJsonLd, normalizedText, publicHttps, publicUrl, publicationJsonLd, publicationMeta, readerSources, recordConsentToCompliance, referralCode, resolveCoupon, resolveEffectiveTheme, resolveLayout, revalidateDecision, secretsMatch, sectionDefinition, sectionId, sectionPath, setTheme, shortDeck, shortText, shouldServeLastKnown, storyDate, storyTowns, subscribeTheme, themeInitScript, townSlug, validCalendarDate, walnutCreekTimes, withLastKnown };
|
|
314
|
+
export { ANALYTICS_COOKIE, ANALYTICS_VERSION, ArticleProvenance, type Attribution, BROADSHEET_THEME, COOKIE_CATEGORIES, CouponOffer, EDITORIAL_SECTION_ORDER, EVENTS, EditorialSection, type EffectiveTheme, FeatureName, HomepageSelection, LAYOUT_COOKIE, NEWS_CACHE, NearbyUpdate, NewsArticle, NewsError, NewsItem, NewsPublication, PublicationInput, PublicationTheme, SESSION_IDLE_MS, THEME_COOKIE, THEME_EVENT, THEME_MAX_AGE_SECONDS, THEME_STORAGE_KEY, type ThemeMode, UTM_FIELDS, UUID, activeNearby, applyTheme, articleCacheKey, articleCacheOptions, articleMeta, articleUrl, attribution, briefSummary, clearTheme, composeEdition, defaultRevalidateTargets, definePublication, displayHeadline, edgeCacheControl, editorialSections, featureEnabled, feedCacheKey, feedCacheOptions, filterNews, getStoredTheme, getSystemTheme, inventoryCacheOptions, llmsText, matchesStoryTag, nearbyUpdates, newsArticleJsonLd, normalizedText, orderedSections, publicHttps, publicUrl, publicationJsonLd, publicationMeta, readerSources, recordConsentToCompliance, referralCode, resolveCoupon, resolveEffectiveTheme, resolveLayout, revalidateDecision, secretsMatch, sectionDefinition, sectionId, sectionPath, setTheme, shortDeck, shortText, shouldServeLastKnown, storyDate, storyTowns, subscribeTheme, themeInitScript, townSlug, validCalendarDate, walnutCreekTimes, withLastKnown };
|
package/dist/index.js
CHANGED
|
@@ -18,7 +18,7 @@ var walnutCreekTimes = definePublication({
|
|
|
18
18
|
regionLabel: "Walnut Creek",
|
|
19
19
|
towns: ["Walnut Creek", "Rossmoor", "Saranap", "Pleasant Hill"],
|
|
20
20
|
nearbyTowns: ["Martinez", "Concord", "Contra Costa"],
|
|
21
|
-
sections: ["Civic life", "Community", "Local businesses", "
|
|
21
|
+
sections: ["Civic life", "Community", "Local businesses", "Real Estate", "Food & places", "Events", "Health"],
|
|
22
22
|
description: "Local news, independent businesses and community voices from Walnut Creek, Rossmoor, Saranap and Pleasant Hill.",
|
|
23
23
|
layout: "broadsheet",
|
|
24
24
|
layouts: ["broadsheet"],
|
|
@@ -110,9 +110,30 @@ function defaultRevalidateTargets() {
|
|
|
110
110
|
|
|
111
111
|
// src/editorial.ts
|
|
112
112
|
var labels = {
|
|
113
|
-
"Local businesses": "
|
|
113
|
+
"Local businesses": "Business",
|
|
114
|
+
"Events": "Things to do",
|
|
114
115
|
"Food & places": "Food & drink"
|
|
115
116
|
};
|
|
117
|
+
var EDITORIAL_SECTION_ORDER = [
|
|
118
|
+
"Civic life",
|
|
119
|
+
"Community",
|
|
120
|
+
"Local businesses",
|
|
121
|
+
"Real Estate",
|
|
122
|
+
"Food & places",
|
|
123
|
+
"Events",
|
|
124
|
+
"Health",
|
|
125
|
+
"Schools",
|
|
126
|
+
"Opinion"
|
|
127
|
+
];
|
|
128
|
+
function orderedSections(sections, order = EDITORIAL_SECTION_ORDER) {
|
|
129
|
+
return sections.filter((section) => section.name !== "Local news").slice().sort((left, right) => {
|
|
130
|
+
const leftRank = order.indexOf(left.name);
|
|
131
|
+
const rightRank = order.indexOf(right.name);
|
|
132
|
+
const leftOrder = leftRank === -1 ? order.length : leftRank;
|
|
133
|
+
const rightOrder = rightRank === -1 ? order.length : rightRank;
|
|
134
|
+
return leftOrder - rightOrder || left.name.localeCompare(right.name);
|
|
135
|
+
});
|
|
136
|
+
}
|
|
116
137
|
function sectionId(name) {
|
|
117
138
|
return "section-" + name.normalize("NFKD").replace(/\p{Mark}/gu, "").toLowerCase().replace(/[^\p{Letter}\p{Number}]+/gu, "-").replace(/^-|-$/g, "");
|
|
118
139
|
}
|
|
@@ -256,11 +277,16 @@ function newsArticleJsonLd(publication, article, canonical, authorName) {
|
|
|
256
277
|
headline: article.title,
|
|
257
278
|
description: article.excerpt ?? void 0,
|
|
258
279
|
datePublished: article.published_at,
|
|
259
|
-
|
|
280
|
+
// updated_at also changes for media/operational maintenance. A trusted
|
|
281
|
+
// editorial modification timestamp is required before emitting dateModified.
|
|
260
282
|
image: image ? [image] : void 0,
|
|
261
|
-
mainEntityOfPage:
|
|
283
|
+
mainEntityOfPage: url,
|
|
262
284
|
url,
|
|
263
|
-
|
|
285
|
+
...canonicalUrl !== url ? { isBasedOn: canonicalUrl } : {},
|
|
286
|
+
articleSection: article.section || void 0,
|
|
287
|
+
// The publication byline is known to be an organization. Do not infer a
|
|
288
|
+
// person's identity or classify an untyped external byline as a newsroom.
|
|
289
|
+
author: { ...!authorName || authorName === publication.name ? { "@type": "Organization" } : {}, name: authorName || publication.name },
|
|
264
290
|
publisher: { "@type": "NewsMediaOrganization", name: publication.name, url: canonical }
|
|
265
291
|
};
|
|
266
292
|
}
|
|
@@ -295,17 +321,17 @@ function articleMeta(publication, article, canonical, indexable) {
|
|
|
295
321
|
const canonicalUrl = publicHttps(article.canonical_url) ?? url;
|
|
296
322
|
const image = publicHttps(article.og_image_url) ?? publicHttps(article.cover_image_url);
|
|
297
323
|
return {
|
|
298
|
-
title: article.
|
|
324
|
+
title: article.title,
|
|
299
325
|
description: article.seo_description ?? article.excerpt ?? publication.description,
|
|
300
326
|
canonical: canonicalUrl,
|
|
301
327
|
indexable: indexable && !article.no_index,
|
|
302
328
|
openGraph: {
|
|
303
329
|
type: "article",
|
|
330
|
+
siteName: publication.name,
|
|
304
331
|
title: article.title,
|
|
305
332
|
description: article.excerpt ?? void 0,
|
|
306
333
|
url,
|
|
307
334
|
publishedTime: article.published_at,
|
|
308
|
-
modifiedTime: article.updated_at,
|
|
309
335
|
images: image ? [image] : []
|
|
310
336
|
}
|
|
311
337
|
};
|
|
@@ -491,4 +517,4 @@ function readerSources(input) {
|
|
|
491
517
|
return output;
|
|
492
518
|
}
|
|
493
519
|
|
|
494
|
-
export { ANALYTICS_COOKIE, ANALYTICS_VERSION, ArticleProvenance, EVENTS, NEWS_CACHE, NewsError, SESSION_IDLE_MS, UTM_FIELDS, UUID, activeNearby, articleCacheKey, articleCacheOptions, articleMeta, articleUrl, attribution, briefSummary, composeEdition, defaultRevalidateTargets, displayHeadline, edgeCacheControl, editorialSections, feedCacheKey, feedCacheOptions, filterNews, inventoryCacheOptions, llmsText, matchesStoryTag, nearbyUpdates, newsArticleJsonLd, normalizedText, publicHttps, publicUrl, publicationJsonLd, publicationMeta, readerSources, referralCode, resolveCoupon, revalidateDecision, secretsMatch, sectionDefinition, sectionId, sectionPath, shortDeck, shortText, shouldServeLastKnown, storyDate, storyTowns, townSlug, validCalendarDate, walnutCreekTimes, withLastKnown };
|
|
520
|
+
export { ANALYTICS_COOKIE, ANALYTICS_VERSION, ArticleProvenance, EDITORIAL_SECTION_ORDER, EVENTS, NEWS_CACHE, NewsError, SESSION_IDLE_MS, UTM_FIELDS, UUID, activeNearby, articleCacheKey, articleCacheOptions, articleMeta, articleUrl, attribution, briefSummary, composeEdition, defaultRevalidateTargets, displayHeadline, edgeCacheControl, editorialSections, feedCacheKey, feedCacheOptions, filterNews, inventoryCacheOptions, llmsText, matchesStoryTag, nearbyUpdates, newsArticleJsonLd, normalizedText, orderedSections, publicHttps, publicUrl, publicationJsonLd, publicationMeta, readerSources, referralCode, resolveCoupon, revalidateDecision, secretsMatch, sectionDefinition, sectionId, sectionPath, shortDeck, shortText, shouldServeLastKnown, storyDate, storyTowns, townSlug, validCalendarDate, walnutCreekTimes, withLastKnown };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scalemule/news-publication",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20",
|
|
4
4
|
"description": "Shared server framework for ScaleMule local news publications. Walnut Creek Times is the broadsheet default; each paper supplies its own identity and feature flags.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|