@salesforcedevs/docs-components 1.3.55-seo-test4 → 1.3.55-seo-test5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforcedevs/docs-components",
3
- "version": "1.3.55-seo-test4",
3
+ "version": "1.3.55-seo-test5",
4
4
  "description": "Docs Lightning web components for DSC",
5
5
  "license": "MIT",
6
6
  "main": "index.js",
@@ -676,10 +676,14 @@ export default class DocXmlContent extends LightningElementWithState<{
676
676
  }
677
677
  }
678
678
 
679
+ this.addNoIndexMetaForOlderDocVersions();
680
+ }
681
+
682
+ private addNoIndexMetaForOlderDocVersions() {
679
683
  // eslint-disable-next-line @lwc/lwc/no-document-query
680
684
  const headTag = document.getElementsByTagName("head");
681
685
  // this checks if the selected version is not the latest version,
682
- // then it adds the noindex, follow meta tag to the non-latest version pages.
686
+ // then it adds the noindex, follow meta tag to the older version pages.
683
687
  // assumption is that first version in the availableVersions array is the latest.
684
688
  if (
685
689
  headTag.length &&
@@ -687,10 +691,10 @@ export default class DocXmlContent extends LightningElementWithState<{
687
691
  this.availableVersions.length &&
688
692
  this.version.id !== this.availableVersions[0].id
689
693
  ) {
690
- const robotsNoFollowMeta = document.createElement("meta");
691
- robotsNoFollowMeta.setAttribute("name", "robots");
692
- robotsNoFollowMeta.setAttribute("content", "noindex, follow");
693
- headTag[0].appendChild(robotsNoFollowMeta);
694
+ const robotsMeta = document.createElement("meta");
695
+ robotsMeta.setAttribute("name", "robots");
696
+ robotsMeta.setAttribute("content", "noindex, follow");
697
+ headTag[0].appendChild(robotsMeta);
694
698
  }
695
699
  }
696
700
  }