Template
Initial react editor Next.js template
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
import type { Metadata } from 'next';
|
||||
import { site } from '@/config/site';
|
||||
|
||||
interface EditorPage {
|
||||
root?: {
|
||||
props?: {
|
||||
title?: string;
|
||||
description?: string;
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
export function pageMetadata(page: EditorPage, overrides: { path?: string } = {}): Metadata {
|
||||
const props = page.root?.props ?? {};
|
||||
const title = props.title ?? site.name;
|
||||
const description = props.description ?? site.description;
|
||||
|
||||
return {
|
||||
title: { absolute: title },
|
||||
description,
|
||||
alternates: overrides.path ? { canonical: overrides.path } : undefined,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user