Skip to content

Commit

Permalink
Add descriptions to every page
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianMachado committed Sep 5, 2024
1 parent a90a1ce commit 4a79d3b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/app/[...slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,12 @@ export async function generateMetadata({
return {};
}

const { data } = result;
const { data, source } = result;
return {
title: data.title,
// Take the first sentence as description, its typically the summary or
// introduction
description: source.split(".")[0],
alternates: {
canonical: `/${params.slug.join("/")}`,
},
Expand Down
2 changes: 2 additions & 0 deletions src/app/articles/node-modules/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import Callout from "../../../components/markdown/Callout";

export const metadata = {
title: "Node Modules",
description:
"List of Node Modules supported by Zuplo. To ensure the security and performance, we must approve each module.",
alternates: {
canonical: `/articles/node-modules`,
},
Expand Down
2 changes: 2 additions & 0 deletions src/app/errors/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import Link from "next/link";

export const metadata: Metadata = {
title: "Zuplo Errors",
description:
"Detailed error messages to help you diagnose and fix the problem.",
alternates: {
canonical: "/errors",
},
Expand Down
1 change: 1 addition & 0 deletions src/app/policies/[slug]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ export async function generateMetadata({
const { schema } = policy;
return {
title: schema.title,
description: schema.description,
alternates: {
canonical: `/policies/${params.slug}`,
},
Expand Down
2 changes: 2 additions & 0 deletions src/app/policies/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import { DocsLayout } from "../../components/DocsLayout";

export const metadata: Metadata = {
title: "Policies Catalog",
description:
"Zuplo includes many policies for securing, scaling, and monitoring your API.",
alternates: {
canonical: "/policies",
},
Expand Down

0 comments on commit 4a79d3b

Please sign in to comment.