Skip to content

Commit 6e52c89

Browse files
Merge pull request #665 from DuendeSoftware/category-og-image
Refactor descriptions and enhance Open Graph image rendering
2 parents a7efa79 + 9bcd9a4 commit 6e52c89

6 files changed

Lines changed: 33 additions & 5 deletions

File tree

src/assets/duende-og-bg-2.png

519 KB
Loading

src/assets/duende-og-bg.png

-355 Bytes
Loading

src/components/duende-og-image.tsx

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,36 @@ const { twj } = await import("tw-to-css");
44
import fs from "node:fs";
55
import path from "node:path";
66

7-
const filePath = path.join(process.cwd(), "src", "assets", "duende-og-bg.png");
7+
const filePath = path.join(
8+
process.cwd(),
9+
"src",
10+
"assets",
11+
"duende-og-bg-2.png",
12+
);
813
const imageBase64 = `data:image/png;base64,${fs.readFileSync(filePath).toString("base64")}`;
914

1015
export async function duendeOpenGraphImage({
1116
title,
1217
description,
18+
url,
1319
}: RenderFunctionInput): Promise<React.ReactNode> {
20+
let category =
21+
url
22+
.match(/\/([\w-]+)\//)
23+
?.at(1)
24+
?.toLowerCase() ?? "";
25+
26+
const categoryMap: Record<string, string> = {
27+
bff: "BFF",
28+
identityserver: "IdentityServer",
29+
accesstokenmanagement: "Access Token Management",
30+
identitymodel: "IdentityModel",
31+
general: "General",
32+
"identitymodel-oidcclient": "IdentityModel OIDC Client",
33+
};
34+
35+
category = categoryMap[category] ?? "General";
36+
1437
return Promise.resolve(
1538
<div
1639
style={{
@@ -31,7 +54,12 @@ export async function duendeOpenGraphImage({
3154
"flex flex-col justify-end justify-items-start w-full h-full p-20",
3255
)}
3356
>
34-
<h1 style={twj("text-[75px] text-bold text-white")}>{title}</h1>
57+
{category && (
58+
<div style={twj("text-2xl italic font-bold text-gray-500 mt-4")}>
59+
{category}
60+
</div>
61+
)}
62+
<h1 style={twj("text-[70px] text-bold text-white")}>{title}</h1>
3563
<div style={twj("text-3xl text-bold mb-3 text-white")}>
3664
{description}
3765
</div>

src/content/docs/identityserver/quickstarts/4-entity-framework.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Entity Framework Core For Configuration & Operational data"
2+
title: "Entity Framework Core: Configuration & Operational Data"
33
description: "Learn how to configure IdentityServer to use Entity Framework Core for storing configuration and operational data in a persistent database."
44
date: 2020-09-10T08:22:12+02:00
55
sidebar:

src/content/docs/identityserver/reference/stores/pushed-authorization-request-store.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: "Pushed Authorization Request Store"
3-
description: Documentation for the IPushedAuthorizationRequestStore interface which manages the storage, retrieval, and consumption of pushed authorization requests in the OAuth PAR flow.
3+
description: Interface for managing pushed authorization requests storage in OAuth PAR flow.
44
sidebar:
55
order: 110
66
redirect_from:

src/content/docs/identityserver/tokens/par.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
title: Pushed Authorization Requests
3-
description: "A comprehensive guide to implementing Pushed Authorization Requests (PAR) in IdentityServer, an OAuth standard that enhances security by moving authorization parameters from the front channel to the back channel, with details on licensing, client usage, data storage, and configuration options."
3+
description: "Pushed Authorization Requests (PAR) in IdentityServer, an OAuth standard that enhances security by moving authorization parameters from the front channel to the back channel."
44
sidebar:
55
order: 175
66
redirect_from:

0 commit comments

Comments
 (0)