+
- {type === "documentation" ? (
-
- ) : null}
- {type}
-
-
- {trueHeading}
+ />
+
+
+ Docs
+
+ {version ? (
+ // Nudged up so the smaller baseline-aligned text does not sag next to the mark
+
+ {version}
+
+ ) : null}
-
-
- Better Auth.
-
-
-
-
+ {section ? (
+
- github.com/better-auth/better-auth
-
+ {section}
+
+ ) : null}
+
+ {trimmedHeading}
@@ -185,24 +174,15 @@ export async function GET(req: Request) {
{
width: 1200,
height: 630,
- fonts: [
- {
- name: "Geist",
- data: geist,
- weight: 400,
- style: "normal",
- },
- {
- name: "GeistMono",
- data: geistMono,
- weight: 700,
- style: "normal",
- },
- ],
+ fonts: [{ name: "Geist", data: geist, weight: 400, style: "normal" }],
+ headers: {
+ "Cache-Control":
+ "public, max-age=86400, s-maxage=31536000, immutable",
+ },
},
);
} catch (err) {
console.log({ err });
- return new Response("Failed to generate the og image", { status: 500 });
+ return new Response("Failed to generate the OG image", { status: 500 });
}
}
diff --git a/docs/app/blog/layout.tsx b/docs/app/blog/layout.tsx
index 6d8f0334d0..f6c96ece3a 100644
--- a/docs/app/blog/layout.tsx
+++ b/docs/app/blog/layout.tsx
@@ -11,10 +11,10 @@ export const metadata: Metadata = createMetadata({
url: "/blog",
title: "Blog - Better Auth",
description,
- images: ["/api/og-release?heading=Better%20Auth%20Blog"],
+ images: ["/api/og-blog?title=Better%20Auth%20Blog"],
},
twitter: {
- images: ["/api/og-release?heading=Better%20Auth%20Blog"],
+ images: ["/api/og-blog?title=Better%20Auth%20Blog"],
title: "Blog - Better Auth",
description,
},
diff --git a/docs/app/docs/[[...slug]]/page.tsx b/docs/app/docs/[[...slug]]/page.tsx
index 56296918cf..bbaf10b071 100644
--- a/docs/app/docs/[[...slug]]/page.tsx
+++ b/docs/app/docs/[[...slug]]/page.tsx
@@ -1,3 +1,4 @@
+import { getBreadcrumbItems } from "fumadocs-core/breadcrumb";
import { Accordion, Accordions } from "fumadocs-ui/components/accordion";
import { File, Files, Folder } from "fumadocs-ui/components/files";
import { Step, Steps } from "fumadocs-ui/components/steps";
@@ -227,10 +228,13 @@ export async function generateMetadata({
? `${version.label} - ${page.data.title}`
: page.data.title;
+ const [section] = getBreadcrumbItems(page.url, src.getPageTree());
const ogSearchParams = new URLSearchParams();
- ogSearchParams.set("heading", title);
- ogSearchParams.set("type", "documentation");
- ogSearchParams.set("mode", "dark");
+ ogSearchParams.set("heading", page.data.title);
+ if (typeof section?.name === "string") {
+ ogSearchParams.set("section", section.name);
+ }
+ if (version.id !== "latest") ogSearchParams.set("version", version.label);
const ogUrl = `/api/og?${ogSearchParams.toString()}`;
diff --git a/docs/lib/rss.ts b/docs/lib/rss.ts
index 0673e4d0b2..488ed0ffb3 100644
--- a/docs/lib/rss.ts
+++ b/docs/lib/rss.ts
@@ -10,7 +10,7 @@ export function getRSS() {
id: `${baseUrl}blog`,
link: `${baseUrl}blog`,
language: "en",
- image: `${baseUrl}release-og/blogs.png`,
+ image: `${baseUrl}og.png`,
favicon: `${baseUrl}favicon/favicon-32x32.png`,
copyright: `All rights reserved ${new Date().getFullYear()}, Better Auth Inc.`,
});