Skip to content

Commit

Permalink
fix: use full link as canonical links for blog entries (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
gsteenkamp89 authored Sep 16, 2024
1 parent 848ede8 commit 367758d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/app/(routes)/blog/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import ShareLink from "./_components/share-link";
import ArticleSnippetCard from "../_components/article-snippet-card";
import { Metadata } from "next";
import { documentToPlainTextString } from "@contentful/rich-text-plain-text-renderer";
import { SITE_BASE_URL } from "@/app/_constants/links";

type SpecificBlogPageProps = { params: { slug: string } };

Expand All @@ -33,12 +34,10 @@ export async function generateMetadata({

return {
keywords: entry.fields.tag ?? [],
metadataBase: new URL(SITE_BASE_URL),
publisher: "Across Protocol",
alternates: {
canonical: "/",
languages: {
"en-US": "/en-US",
},
canonical: `/blog/${params.slug}`,
},
title,
description,
Expand All @@ -51,6 +50,13 @@ export async function generateMetadata({
title,
images: [imageUrl],
},
openGraph: {
siteName: "Across Protocol",
title,
description,
images: [imageUrl],
url: `/blog/${params.slug}`,
},
};
}

Expand Down
2 changes: 2 additions & 0 deletions src/app/_constants/links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,3 +56,5 @@ export const INTEGRATION_LINKS = {
settlement:
"https://docs.across.to/v/v3-developer-docs/concepts/intents-architecture-in-across",
};

export const SITE_BASE_URL = "https://across.to" as const;

0 comments on commit 367758d

Please sign in to comment.