Search Engine Optimization - MindVista/website GitHub Wiki
SEO titles and meta descriptions for each page are pulled from Payload's Pages
collection.
Metadata is exported as such in each page's code:
import { Metadata } from "next";
import { getPageFromCMS } from "@/lib/getPageFromCMS";
export async function generateMetadata(): Promise<Metadata> {
const page = await getPageFromCMS("page-slug-here");
return {
...(page && {
title: page.title,
description: page.seoDescription,
}),
};
}
SEO title and description are respectively pulled from the title
and description
fields of Payload's Clubs
or Resources
collection.