@quintype/seo 1.40.6-og-image.0 → 1.40.7

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,15 @@
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.40.7](https://github.com/quintype/quintype-node-seo/compare/v1.40.6...v1.40.7) (2022-07-11)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * Amphtml error ([#526](https://github.com/quintype/quintype-node-seo/issues/526)) ([24b6c61](https://github.com/quintype/quintype-node-seo/commit/24b6c616118f3db1a2cdda0d98d2827bf2a0d099))
11
+
12
+ ### [1.40.6](https://github.com/quintype/quintype-node-seo/compare/v1.40.5...v1.40.6) (2022-07-11)
13
+
5
14
  ### [1.40.5](https://github.com/quintype/quintype-node-seo/compare/v1.40.1...v1.40.5) (2022-06-30)
6
15
 
7
16
 
package/dist/index.cjs.js CHANGED
@@ -1090,11 +1090,13 @@ function StoryAmpTags(seoConfig, config, pageType, data = {}, opts) {
1090
1090
  // TODO: Remove this condition and always make absolute URL if that's better for AMP discoverability.
1091
1091
  const ampUrlAppend = seoConfig.appendHostToAmpUrl ? getDomain(currentHostUrl, domainSlug) || config['sketches-host'] : '';
1092
1092
  const storySlug = seoConfig.decodeAmpUrl ? decodeURIComponent(story.slug) : encodeURIComponent(story.slug);
1093
+ const ampUrl = story["story-template"] === "visual-story" ? `${ampUrlAppend}/${storySlug}` : `${ampUrlAppend}/amp/story/${storySlug}`;
1094
+
1093
1095
  if (showAmpTag(seoConfig, pageType, story)) {
1094
1096
  return [{
1095
1097
  tag: 'link',
1096
1098
  rel: 'amphtml',
1097
- href: `${ampUrlAppend}/amp/story/${storySlug}`
1099
+ href: ampUrl
1098
1100
  }];
1099
1101
  } else {
1100
1102
  return [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/seo",
3
- "version": "1.40.6-og-image.0",
3
+ "version": "1.40.7",
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}`
49
+ href: ampUrl
48
50
  }];
49
51
  } else {
50
52
  return [];
@@ -19,6 +19,12 @@ describe('AmpTags', function () {
19
19
  assertContains('<link rel="amphtml" href="/amp/story/section%2Fslug"/>', string);
20
20
  });
21
21
 
22
+ it("it does not append `/amp/story` to the amp tag when it's a visual story", function () {
23
+ const story = { slug: "section/slug", "is-amp-supported": true };
24
+ const string = getSeoMetadata(seoConfig, config, "story-page", { data: { story: { ...story, "story-template": "visual-story" } } }, {});
25
+ assertContains('<link rel="amphtml" href="/section%2Fslug"/>', string);
26
+ });
27
+
22
28
  it("does not rely on is-amp-supported in story API", function () {
23
29
  const story = { slug: "section/slug", "is-amp-supported": false };
24
30
  const string = getSeoMetadata(seoConfig, config, "story-page", { data: { story: story } }, {});