Skip to content

Commit fcb7867

Browse files
authored
Merge pull request #168 from uidotdev/tyler
Fix canonical link trailing slash
2 parents d026517 + 4e323f0 commit fcb7867

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# useHooks
22

3-
A collection of 50 RSC safe React hooks
3+
A collection of Server Component safe React Hooks – from the ui.dev team
44

55
## Standard
66

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@uidotdev/usehooks",
33
"version": "0.0.5",
4-
"description": "A collection of 50 RSC safe React hooks",
4+
"description": "A collection of Server Component safe React Hooks – from the ui.dev team",
55
"type": "module",
66
"repository": "uidotdev/usehooks",
77
"devDependencies": {

usehooks.com/src/layouts/Layout.astro

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@ const {
1111
title,
1212
description,
1313
ogImage = new URL("/meta/og.jpg", Astro.url),
14-
url = new URL(Astro.url.pathname, Astro.site),
1514
} = Astro.props;
15+
16+
const pathname = Astro.url.pathname
17+
18+
const url = pathname[pathname.length - 1] === "/"
19+
? new URL(pathname.slice(0, pathname.length -1), Astro.site)
20+
: new URL(Astro.url.pathname, Astro.site)
21+
1622
---
1723

1824
<!DOCTYPE html>

0 commit comments

Comments
 (0)