Skip to content

Commit 26e5f0c

Browse files
committed
Debug meta issues again
1 parent e6fb0b2 commit 26e5f0c

File tree

33 files changed

+75
-105
lines changed

33 files changed

+75
-105
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
repos:
23
- repo: "https://github.com/DavidAnson/markdownlint-cli2"
34
rev: "v0.14.0"

.yamllint

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ yaml-files:
66
- ".yamllint"
77
ignore: |
88
pnpm-lock.yaml
9+
pnpm-workspace.yaml
910
node_modules/
1011
extends: "default"
1112
rules:

TODO.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
- [x] check behavior of search bar, especially around docs results ranking higher than non-docs
66
- [x] make sure that search bar works (check pagefind)
77
- [x] finish pagefind thought
8-
- [ ] make styling of swagger page look nice
9-
- [ ] ensure that metadata is still showing up as expected
10-
- [ ] do migration to app folder
11-
- [ ] make sure that app.tsx is rendering properly
8+
- [ ] make styling of swagger page look nice (?)
9+
- [x] ensure that metadata is still showing up as expected
10+
- [x] do migration to app folder
11+
- [ ] make sure that app.tsx is rendering properly (not sure what i meant by this)
12+
- [ ] rebase

app/authzed/api/_meta.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1+
import type { MetaRecord } from "nextra";
2+
13
export default {
24
"grpc-api": {
35
title: "gRPC API Reference",
46
href: "https://buf.build/authzed/api/docs/main:authzed.api.v1",
5-
newWindow: true,
67
},
78
"http-api": {
89
title: "HTTP API Reference",
910
},
1011
"cloud-api": {
1112
title: "Cloud API Reference",
1213
href: "https://www.postman.com/authzed/spicedb/collection/5fm402n/authzed-cloud-api",
13-
newWindow: true,
1414
},
15-
};
15+
} satisfies MetaRecord;

app/authzed/api/http-api/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Swagger } from "../../../components/swagger";
1+
import { Swagger } from "@/components/swagger";
22

33
# HTTP API Documentation
44

app/authzed/concepts/workload-isolation/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import YouTube from "react-youtube";
1+
import YouTube from "@/components/youtube-wrapper";
22

33
# Workload Isolation
44

app/authzed/guides/cloud/page.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Callout } from "nextra/components";
2-
import YouTube from "react-youtube";
2+
import YouTube from "@/components/youtube-wrapper";
33

44
# Getting Started with AuthZed Cloud
55

app/authzed/links/_meta.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,20 @@
1+
import type { MetaRecord } from "nextra";
2+
13
export default {
24
schedule: {
35
title: "Schedule a Call",
46
href: "https://authzed.com/call?utm_source=docs",
5-
newWindow: true,
67
},
78
changelog: {
89
title: "Changelog",
910
href: "https://changelog.authzed.cloud?utm_source=docs",
10-
newWindow: true,
1111
},
1212
"security-policies": {
1313
title: "Security Policies",
1414
href: "https://security.authzed.com?utm_source=docs",
15-
newWindow: true,
1615
},
1716
status: {
1817
title: "Service Status Page",
1918
href: "https://status.authzed.com?utm_source=docs",
20-
newWindow: true,
2119
},
22-
};
20+
} satisfies MetaRecord;

app/layout.tsx

Lines changed: 27 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,38 @@ import LogoIcon from "@/components/icons/logo-icon.svg";
88
import BannerContents from "@/components/banner";
99
import Providers from "@/components/providers";
1010
import { TocCTA } from "@/components/cta";
11-
import type { Metadata } from "next";
11+
import type { Metadata, ResolvingMetadata } from "next";
1212
import { SpeedInsights } from "@vercel/speed-insights/next";
1313
import "./globals.css";
1414

1515
import { 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

2745
export 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}>

app/page.mdx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
#
1+
---
2+
title: Authzed Docs
3+
---
24

35
Browse documentation for **SpiceDB** or **AuthZed Products** by selecting one below.
46

0 commit comments

Comments
 (0)