@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 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: `${ampUrlAppend}/amp/story/${storySlug.replace("ampstories/", "")}`
1068
+ href: ampUrl
1067
1069
  }];
1068
1070
  } else {
1069
1071
  return [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/seo",
3
- "version": "1.40.5-amphtml-issue.0",
3
+ "version": "1.40.5-amphtml-issue.1",
4
4
  "description": "SEO Modules for Quintype",
5
5
  "main": "dist/index.cjs.js",
6
6
  "repository": "https://github.com/quintype/quintype-node-seo",
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: `${ampUrlAppend}/amp/story/${storySlug.replace("ampstories/", "")}`
49
+ href: ampUrl
48
50
  }];
49
51
  } else {
50
52
  return [];