chore: canonical seo issue (#5852)

This commit is contained in:
Harsh Bhat
2025-05-21 19:08:41 +05:30
committed by GitHub
parent f7e5ef96d2
commit 639e25d679
2 changed files with 14 additions and 0 deletions
@@ -75,6 +75,9 @@ describe("getMetadataForLinkSurvey", () => {
title: mockSurveyName,
images: [mockOgImageUrl],
},
alternates: {
canonical: `/s/${mockSurveyId}`,
},
});
});
@@ -147,6 +150,9 @@ describe("getMetadataForLinkSurvey", () => {
title: mockSurveyName,
images: [mockOgImageUrl],
},
alternates: {
canonical: `/s/${mockSurveyId}`,
},
});
});
@@ -174,6 +180,9 @@ describe("getMetadataForLinkSurvey", () => {
title: mockSurveyName,
images: [mockOgImageUrl],
},
alternates: {
canonical: `/s/${mockSurveyId}`,
},
});
});
});
+5
View File
@@ -27,8 +27,13 @@ export const getMetadataForLinkSurvey = async (surveyId: string): Promise<Metada
baseMetadata.twitter.images = [ogImgURL];
}
const canonicalPath = `/s/${surveyId}`;
return {
title: survey.name,
...baseMetadata,
alternates: {
canonical: canonicalPath,
},
};
};