1
0
mirror of https://github.com/kamranahmedse/developer-roadmap.git synced 2025-08-27 02:54:27 +02:00

Fix canonicals

This commit is contained in:
Kamran Ahmed
2023-01-08 06:25:19 +04:00
parent d9697b74fd
commit 66cb4f9a06

View File

@@ -27,7 +27,11 @@ const {
sponsor, sponsor,
} = Astro.props; } = Astro.props;
const currentPageAbsoluteUrl = `https://roadmap.sh${permalink}`; // Remove trailing slashes to consider the page as canonical
const currentPageAbsoluteUrl = `https://roadmap.sh${permalink.replace(
/\/$/,
''
)}`;
--- ---
<!DOCTYPE html> <!DOCTYPE html>
@@ -59,7 +63,7 @@ const currentPageAbsoluteUrl = `https://roadmap.sh${permalink}`;
<meta property='og:type' content='website' /> <meta property='og:type' content='website' />
<meta property='og:url' content={currentPageAbsoluteUrl} /> <meta property='og:url' content={currentPageAbsoluteUrl} />
<link rel='canonical' href={currentPageAbsoluteUrl} /> {currentPageAbsoluteUrl !== 'https://roadmap.sh' && <link rel='canonical' href={currentPageAbsoluteUrl} /> }
<meta name='mobile-web-app-capable' content='yes' /> <meta name='mobile-web-app-capable' content='yes' />
<meta name='apple-mobile-web-app-capable' content='yes' /> <meta name='apple-mobile-web-app-capable' content='yes' />