@quintype/seo 1.40.5-amphtml-issue.0 → 1.40.5-amphtml-issue.1
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.js +3 -1
- package/package.json +1 -1
- package/src/amp-tags.js +3 -1
package/dist/index.cjs.js
CHANGED
|
@@ -1059,11 +1059,13 @@ function StoryAmpTags(seoConfig, config, pageType, data = {}, opts) {
|
|
|
1059
1059
|
// TODO: Remove this condition and always make absolute URL if that's better for AMP discoverability.
|
|
1060
1060
|
const ampUrlAppend = seoConfig.appendHostToAmpUrl ? getDomain(currentHostUrl, domainSlug) || config['sketches-host'] : '';
|
|
1061
1061
|
const storySlug = seoConfig.decodeAmpUrl ? decodeURIComponent(story.slug) : encodeURIComponent(story.slug);
|
|
1062
|
+
const ampUrl = story["story-template"] === "visual-story" ? `${ampUrlAppend}/${storySlug}` : `${ampUrlAppend}/amp/story/${storySlug}`;
|
|
1063
|
+
|
|
1062
1064
|
if (showAmpTag(seoConfig, pageType, story)) {
|
|
1063
1065
|
return [{
|
|
1064
1066
|
tag: 'link',
|
|
1065
1067
|
rel: 'amphtml',
|
|
1066
|
-
href:
|
|
1068
|
+
href: ampUrl
|
|
1067
1069
|
}];
|
|
1068
1070
|
} else {
|
|
1069
1071
|
return [];
|
package/package.json
CHANGED
package/src/amp-tags.js
CHANGED
|
@@ -40,11 +40,13 @@ export function StoryAmpTags(seoConfig, config, pageType, data = {}, opts) {
|
|
|
40
40
|
// TODO: Remove this condition and always make absolute URL if that's better for AMP discoverability.
|
|
41
41
|
const ampUrlAppend = seoConfig.appendHostToAmpUrl ? getDomain(currentHostUrl, domainSlug) || config['sketches-host'] : '';
|
|
42
42
|
const storySlug = seoConfig.decodeAmpUrl ? decodeURIComponent(story.slug): encodeURIComponent(story.slug);
|
|
43
|
+
const ampUrl = story["story-template"] === "visual-story" ? `${ampUrlAppend}/${storySlug}` : `${ampUrlAppend}/amp/story/${storySlug}`;
|
|
44
|
+
|
|
43
45
|
if (showAmpTag(seoConfig, pageType, story)) {
|
|
44
46
|
return [{
|
|
45
47
|
tag: 'link',
|
|
46
48
|
rel: 'amphtml',
|
|
47
|
-
href:
|
|
49
|
+
href: ampUrl
|
|
48
50
|
}];
|
|
49
51
|
} else {
|
|
50
52
|
return [];
|