@pronto-tools-and-more/custom-js-functions 12.44.0 → 12.46.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/dist/main.js +4 -0
- package/package.json +1 -1
- package/src/parts/ReadTime/ReadTime.ts +4 -0
package/dist/main.js
CHANGED
@@ -487,6 +487,10 @@
|
|
487
487
|
// src/parts/ReadTime/ReadTime.ts
|
488
488
|
var getReadTime = (content) => {
|
489
489
|
const parsedSeo = JSON.parse(content?.properties?.purple_seo_meta);
|
490
|
+
const readTimeNumber = parsedSeo?.est_reading_time_minutes;
|
491
|
+
if (readTimeNumber) {
|
492
|
+
return `${readTimeNumber} min`;
|
493
|
+
}
|
490
494
|
const readTime = parsedSeo?.twitter_misc?.["Est. reading time"] || "n/a";
|
491
495
|
if (typeof readTime === "number") {
|
492
496
|
return `${readTime} min`;
|
package/package.json
CHANGED
@@ -1,5 +1,9 @@
|
|
1
1
|
export const getReadTime = (content: any) => {
|
2
2
|
const parsedSeo = JSON.parse(content?.properties?.purple_seo_meta);
|
3
|
+
const readTimeNumber = parsedSeo?.est_reading_time_minutes;
|
4
|
+
if (readTimeNumber) {
|
5
|
+
return `${readTimeNumber} min`;
|
6
|
+
}
|
3
7
|
const readTime = parsedSeo?.twitter_misc?.["Est. reading time"] || "n/a";
|
4
8
|
if (typeof readTime === "number") {
|
5
9
|
return `${readTime} min`;
|