File tree 7 files changed +12
-2
lines changed
7 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -2,11 +2,13 @@ import { Head } from "$fresh/runtime.ts";
2
2
3
3
export default function Header ( {
4
4
title = "tswhy‽" ,
5
+ canonical,
5
6
description = "A community effort to enrich TypeScript diagnostics." ,
6
7
keywords = [ "typescript" , "diagnostics" ] ,
7
8
ogImage,
8
9
} : {
9
10
title ?: string ;
11
+ canonical ?: string ;
10
12
description ?: string ;
11
13
keywords ?: string [ ] ;
12
14
ogImage ?: URL ;
@@ -50,6 +52,10 @@ export default function Header({
50
52
< meta property = "og:locale" content = "en_AU" />
51
53
52
54
< meta name = "keywords" content = { keywords . join ( ", " ) } />
55
+
56
+ { canonical && (
57
+ < link rel = "canonical" href = { `https://tswhy.com${ canonical } ` } />
58
+ ) }
53
59
</ Head >
54
60
< a href = "/" >
55
61
< img
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ export default async function Contributing() {
20
20
< div class = "p-4 mx-auto max-w-screen-xl" >
21
21
< Header
22
22
title = "tswhy? - Contributing"
23
+ canonical = "/contributing"
23
24
description = "Information on integrating to tswhy‽"
24
25
/>
25
26
< article class = "rounded-lg bg-gray-100 dark:bg-gray-800 my-4 p-8" >
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export default async function EditPage(
18
18
< div class = "p-4 mx-auto max-w-screen-xl" >
19
19
< Header
20
20
title = { `Edit ${ diagnosticData . codeText } ` }
21
+ canonical = { `/edit/ts${ code } ` }
21
22
/>
22
23
< main >
23
24
< Editor diagnosticData = { diagnosticData } />
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ export default function Home() {
13
13
return (
14
14
< >
15
15
< div class = "p-4 mx-auto max-w-screen-xl" >
16
- < Header />
16
+ < Header canonical = "/" />
17
17
< main >
18
18
< div class = "m-4 space-y-2" >
19
19
< p >
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ export default async function Contributing() {
20
20
< div class = "p-4 mx-auto max-w-screen-xl" >
21
21
< Header
22
22
title = "tswhy? - Contributing"
23
+ canonical = "/integrating"
23
24
description = "Information on contributing changes to tswhy‽"
24
25
/>
25
26
< article class = "rounded-lg bg-gray(100 dark:800) my-4 p-8" >
Original file line number Diff line number Diff line change @@ -75,7 +75,7 @@ export default function Proposal(
75
75
return (
76
76
< >
77
77
< div class = "p-4 mx-auto max-w-screen-xl" >
78
- < Header />
78
+ < Header canonical = "/propose" />
79
79
< main >
80
80
< div class = "rounded-lg bg-gray-100 dark:bg-gray-800 my-4 p-4" >
81
81
< h2 class = "text-2xl font-header" > Proposed</ h2 >
Original file line number Diff line number Diff line change @@ -30,6 +30,7 @@ export default function DiagnosticPage(
30
30
title = { `${ diagnosticData . codeText } : ${
31
31
interpolate ( diagnosticData . title , params )
32
32
} `}
33
+ canonical = { `/ts${ diagnosticData . code } ` }
33
34
description = { diagnosticData . documentation ??
34
35
interpolate ( diagnosticData . title , params ) }
35
36
ogImage = { toOgImageUrl ( diagnosticData , params ) }
You can’t perform that action at this time.
0 commit comments