@@ -8,20 +8,38 @@ import LogoIcon from "@/components/icons/logo-icon.svg";
88import BannerContents from "@/components/banner" ;
99import Providers from "@/components/providers" ;
1010import { TocCTA } from "@/components/cta" ;
11- import type { Metadata } from "next" ;
11+ import type { Metadata , ResolvingMetadata } from "next" ;
1212import { SpeedInsights } from "@vercel/speed-insights/next" ;
1313import "./globals.css" ;
1414
1515import { default as OurLayout } from "@/components/layout" ;
1616
1717// TODO: make sure this is all right
18- export const metadata : Metadata = {
19- metadataBase : new URL ( "https://authzed.com" ) ,
20- title : {
21- default : "Authzed Docs" ,
22- template : "%s - Authzed Docs" ,
23- } ,
24- description : "Welcome to the SpiceDB and AuthZed docs site." ,
18+ export const generateMetadata = async (
19+ _props : unknown ,
20+ parentPromise : ResolvingMetadata ,
21+ ) : Promise < Metadata > => {
22+ const { description } = await parentPromise ;
23+ return {
24+ metadataBase : new URL ( "https://authzed.com" ) ,
25+ title : {
26+ default : "Authzed Docs" ,
27+ template : "%s - Authzed Docs" ,
28+ } ,
29+ description : "Welcome to the SpiceDB and AuthZed docs site." ,
30+ openGraph : {
31+ title : {
32+ default : "Authzed Docs" ,
33+ template : "%s - Authzed Docs" ,
34+ } ,
35+ description : description ?? undefined ,
36+ } ,
37+ alternates : {
38+ // This is how you say "the current page is the canonical one",
39+ // using the metadataBase field.
40+ canonical : "./" ,
41+ } ,
42+ } ;
2543} ;
2644
2745export default async function RootLayout ( { children } ) {
@@ -37,25 +55,6 @@ export default async function RootLayout({ children }) {
3755 projectLink = "https://github.com/authzed/spicedb"
3856 />
3957 ) ;
40- // TODO
41- /*
42- const { title: titleContent, frontMatter } = useConfig();
43- const desc =
44- frontMatter.description ||
45- ;
46- const resolvedTitle = titleContent
47- ? `${titleContent} - Authzed Docs`
48- : "Authzed Docs";
49-
50- <meta property="og:title" content={resolvedTitle} />
51- <meta property="og:description" content={desc} />
52- <link
53- rel="canonical"
54- href={`https://authzed.com${
55- process.env.NEXT_PUBLIC_BASE_DIR ?? ""
56- }${asPath}` }
57- />
58- */
5958
6059 return (
6160 < html lang = "en" dir = "ltr" suppressHydrationWarning >
@@ -65,11 +64,7 @@ export default async function RootLayout({ children }) {
6564 saturation : { dark : 100 , light : 100 } ,
6665 } }
6766 />
68- < body
69- // This is how we tell pagefind that this is a doc page
70- // which should rank higher than blogs in search results.
71- data-pagefind-sort = "internal:1"
72- >
67+ < body >
7368 < Layout
7469 banner = {
7570 < Banner dismissible = { false } >
0 commit comments