@quintype/seo 1.44.0 → 1.44.2-fix-brightcove.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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.44.1](https://github.com/quintype/quintype-node-seo/compare/v1.44.0...v1.44.1) (2024-01-04)
|
|
6
|
+
|
|
5
7
|
## [1.44.0](https://github.com/quintype/quintype-node-seo/compare/v1.43.0...v1.44.0) (2024-01-04)
|
|
6
8
|
|
|
7
9
|
## [1.43.0-disable-amp-story.1](https://github.com/quintype/quintype-node-seo/compare/v1.43.0-disable-amp-story.0...v1.43.0-disable-amp-story.1) (2023-11-22)
|
|
@@ -13,6 +15,8 @@ All notable changes to this project will be documented in this file. See [standa
|
|
|
13
15
|
|
|
14
16
|
* disable amp for a particular story ([6b5a76d](https://github.com/quintype/quintype-node-seo/commit/6b5a76da754bf2cbabd9a8d0787095366bf18609))
|
|
15
17
|
|
|
18
|
+
## [1.43.0](https://github.com/quintype/quintype-node-seo/compare/v1.43.0-config-amp-story-path.1...v1.43.0) (2023-12-01)
|
|
19
|
+
|
|
16
20
|
### [1.42.2](https://github.com/quintype/quintype-node-seo/compare/v1.42.1...v1.42.2) (2023-07-06)
|
|
17
21
|
|
|
18
22
|
|
package/dist/index.cjs.js
CHANGED
|
@@ -105,7 +105,8 @@ function StoryAmpTags(seoConfig, config, pageType, data = {}, opts) {
|
|
|
105
105
|
// TODO: Remove this condition and always make absolute URL if that's better for AMP discoverability.
|
|
106
106
|
const ampUrlAppend = seoConfig.appendHostToAmpUrl ? getDomain(currentHostUrl, domainSlug) || config["sketches-host"] : "";
|
|
107
107
|
const storySlug = seoConfig.decodeAmpUrl ? decodeURIComponent(story.slug) : encodeURIComponent(story.slug);
|
|
108
|
-
const
|
|
108
|
+
const { ampPageBasePath = "/amp/story" } = seoConfig;
|
|
109
|
+
const ampUrl = story["story-template"] === "visual-story" ? `${ampUrlAppend}/${storySlug}` : `${ampUrlAppend}${ampPageBasePath}/${storySlug}`;
|
|
109
110
|
const ignoreStoryTemplate = templatesToIgnore.includes(story["story-template"]);
|
|
110
111
|
if (showAmpTag(seoConfig, pageType, story) && !ignoreStoryTemplate) {
|
|
111
112
|
return [{
|
|
@@ -739,10 +740,6 @@ function generateLiveBlogPostingData(structuredData = {}, story = {}, publisherC
|
|
|
739
740
|
|
|
740
741
|
function getEmbedUrl(cards) {
|
|
741
742
|
let embedUrl = "";
|
|
742
|
-
|
|
743
|
-
// not using the return value of top level find
|
|
744
|
-
// coz we only need the embed url
|
|
745
|
-
// find is used for early exit
|
|
746
743
|
cards.find(card => {
|
|
747
744
|
const storyElements = get__default["default"](card, ["story-elements"], []);
|
|
748
745
|
return storyElements.find(elem => {
|
|
@@ -750,6 +747,11 @@ function getEmbedUrl(cards) {
|
|
|
750
747
|
embedUrl = elem["embed-url"];
|
|
751
748
|
return true;
|
|
752
749
|
}
|
|
750
|
+
if (elem.subtype === "brightcove-video" && get__default["default"](elem, ["metadata", "embed-code"])) {
|
|
751
|
+
embedUrl = Buffer.from(elem.metadata["embed-code"], "base64").toString();
|
|
752
|
+
return true;
|
|
753
|
+
}
|
|
754
|
+
|
|
753
755
|
return false;
|
|
754
756
|
});
|
|
755
757
|
});
|
package/package.json
CHANGED
package/src/amp-tags.js
CHANGED
|
@@ -51,10 +51,11 @@ export function StoryAmpTags(seoConfig, config, pageType, data = {}, opts) {
|
|
|
51
51
|
? getDomain(currentHostUrl, domainSlug) || config["sketches-host"]
|
|
52
52
|
: "";
|
|
53
53
|
const storySlug = seoConfig.decodeAmpUrl ? decodeURIComponent(story.slug) : encodeURIComponent(story.slug);
|
|
54
|
+
const { ampPageBasePath = "/amp/story" } = seoConfig;
|
|
54
55
|
const ampUrl =
|
|
55
56
|
story["story-template"] === "visual-story"
|
|
56
57
|
? `${ampUrlAppend}/${storySlug}`
|
|
57
|
-
: `${ampUrlAppend}
|
|
58
|
+
: `${ampUrlAppend}${ampPageBasePath}/${storySlug}`;
|
|
58
59
|
const ignoreStoryTemplate = templatesToIgnore.includes(story["story-template"]);
|
|
59
60
|
if (showAmpTag(seoConfig, pageType, story) && !ignoreStoryTemplate) {
|
|
60
61
|
return [
|
|
@@ -262,10 +262,6 @@ function generateLiveBlogPostingData(structuredData = {}, story = {}, publisherC
|
|
|
262
262
|
|
|
263
263
|
function getEmbedUrl(cards) {
|
|
264
264
|
let embedUrl = "";
|
|
265
|
-
|
|
266
|
-
// not using the return value of top level find
|
|
267
|
-
// coz we only need the embed url
|
|
268
|
-
// find is used for early exit
|
|
269
265
|
cards.find((card) => {
|
|
270
266
|
const storyElements = get(card, ["story-elements"], []);
|
|
271
267
|
return storyElements.find((elem) => {
|
|
@@ -273,6 +269,11 @@ function getEmbedUrl(cards) {
|
|
|
273
269
|
embedUrl = elem["embed-url"];
|
|
274
270
|
return true;
|
|
275
271
|
}
|
|
272
|
+
if (elem.subtype === "brightcove-video" && get(elem, ["metadata", "embed-code"])) {
|
|
273
|
+
embedUrl = Buffer.from(elem.metadata["embed-code"], "base64").toString();
|
|
274
|
+
return true;
|
|
275
|
+
}
|
|
276
|
+
|
|
276
277
|
return false;
|
|
277
278
|
});
|
|
278
279
|
});
|