@salesforcedevs/docs-components 1.3.108-seo-fix1 → 1.3.108-seo-fix3
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
|
@@ -694,8 +694,15 @@ export default class DocXmlContent extends LightningElementWithState<{
|
|
|
694
694
|
const docId = this.pageReference.docId;
|
|
695
695
|
|
|
696
696
|
// SEO fix:
|
|
697
|
-
//
|
|
698
|
-
|
|
697
|
+
// Doc id without version id is always considered latest and should be used for SEO.
|
|
698
|
+
// Condition is to find a docId which includes version id,
|
|
699
|
+
// these docs are always considered as old and should not be indexed including the preview docs.
|
|
700
|
+
if (
|
|
701
|
+
headTag.length &&
|
|
702
|
+
docId?.includes(versionId) &&
|
|
703
|
+
// eslint-disable-next-line @lwc/lwc/no-document-query
|
|
704
|
+
!document.querySelector('meta[name="robots"]')
|
|
705
|
+
) {
|
|
699
706
|
const robotsMeta = document.createElement("meta");
|
|
700
707
|
robotsMeta.setAttribute("name", "robots");
|
|
701
708
|
robotsMeta.setAttribute("content", "noindex, follow");
|