Skip to content

Commit 926780d

Browse files
committed
updating canonical tags in a simpler way
1 parent 3f92818 commit 926780d

3 files changed

Lines changed: 1 addition & 7 deletions

File tree

‎prerender.config.js‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11

22
module.exports = {
3-
canonicalUrl() {
4-
return null;
5-
},
6-
73
filterUrl(url) {
84
if (url.pathname.startsWith('/docs/v3')) {
95
return false;

‎src/components/page/page.tsx‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ export class DocsPage {
6565
const metaEls = {
6666
title: document.head.querySelectorAll('.meta-title'),
6767
description: document.head.querySelectorAll('.meta-description'),
68-
url: document.head.querySelectorAll('.meta-url'),
68+
url: document.head.querySelectorAll('.meta-url, link[rel="canonical"]'),
6969
image: document.head.querySelectorAll('.meta-image')
7070
};
7171

‎src/index.html‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@
5454

5555
<link rel="alternate" hreflang="x-default" href="https://ionicframework.com/docs/" class="meta-url" />
5656
<link rel="alternate" hreflang="ja" href="https://ionicframework.com/jp/docs/" class="meta-url" />
57-
58-
<link rel="canonical" href="https://ionicframework.com/docs/" class="meta-url" />
5957
</head>
6058
<body>
6159

0 commit comments

Comments
 (0)