add canonical url

This commit is contained in:
slorber 2020-05-26 21:03:18 +02:00
parent 9a2129551e
commit cc1705e00c
2 changed files with 6 additions and 15 deletions

View file

@ -7,6 +7,7 @@ Array [
<head>
<meta charset=\\"UTF-8\\">
<meta http-equiv=\\"refresh\\" content=\\"0; url=/abc/\\">
<link rel=\\"canonical\\" href=\\"/abc/\\" />
</head>
<script>
window.location.href = '/abc/';
@ -22,21 +23,7 @@ Array [
<head>
<meta charset=\\"UTF-8\\">
<meta http-equiv=\\"refresh\\" content=\\"0; url=/abc/\\">
</head>
<script>
window.location.href = '/abc/';
</script>
</html>",
]
`;
exports[`toRedirectFilesMetadata should create appropriate metadatas for root baseUrl: fileContent baseUrl=empty 1`] = `
Array [
"<!DOCTYPE html>
<html>
<head>
<meta charset=\\"UTF-8\\">
<meta http-equiv=\\"refresh\\" content=\\"0; url=/abc/\\">
<link rel=\\"canonical\\" href=\\"/abc/\\" />
</head>
<script>
window.location.href = '/abc/';
@ -52,6 +39,7 @@ Array [
<head>
<meta charset=\\"UTF-8\\">
<meta http-equiv=\\"refresh\\" content=\\"0; url=https://docusaurus.io/abc/\\">
<link rel=\\"canonical\\" href=\\"https://docusaurus.io/abc/\\" />
</head>
<script>
window.location.href = 'https://docusaurus.io/abc/';
@ -62,6 +50,7 @@ Array [
<head>
<meta charset=\\"UTF-8\\">
<meta http-equiv=\\"refresh\\" content=\\"0; url=https://docusaurus.io/def.html/\\">
<link rel=\\"canonical\\" href=\\"https://docusaurus.io/def.html/\\" />
</head>
<script>
window.location.href = 'https://docusaurus.io/def.html/';
@ -72,6 +61,7 @@ Array [
<head>
<meta charset=\\"UTF-8\\">
<meta http-equiv=\\"refresh\\" content=\\"0; url=https://docusaurus.io/\\">
<link rel=\\"canonical\\" href=\\"https://docusaurus.io/\\" />
</head>
<script>
window.location.href = 'https://docusaurus.io/';

View file

@ -11,6 +11,7 @@ export default `
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="0; url=<%= it.toUrl %>">
<link rel="canonical" href="<%= it.toUrl %>" />
</head>
<script>
window.location.href = '<%= it.toUrl %>';