Skip to content

Commit

Permalink
Add canonical tag to every URL
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiodxa committed Jan 18, 2024
1 parent d3c4270 commit f33a4ee
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions app/root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
Scripts,
ScrollRestoration,
useLoaderData,
useLocation,
} from "@remix-run/react";
import { useEffect } from "react";
import { useTranslation } from "react-i18next";
Expand Down Expand Up @@ -129,6 +130,8 @@ function Document({
}) {
let shouldHydrate = useShouldHydrate();
let dir = useDirection();
let location = useLocation();

return (
<html lang={locale} dir={dir} className="h-full">
<head>
Expand Down Expand Up @@ -172,6 +175,10 @@ function Document({
rel="pingback"
href="https://webmention.io/sergiodxa.com/xmlrpc"
/>
<link
rel="canonical"
href={`https://sergiodxa.com${location.pathname}`}
/>
</head>
<body className="min-h-full bg-neutral-50 font-sans text-neutral-900">
{children}
Expand Down

0 comments on commit f33a4ee

Please sign in to comment.