Skip to content

Commit 92ffcce

Browse files
Merge pull request #659 from DuendeSoftware/open-graph-images
Add dynamic Open Graph image handling
2 parents 3a0b72b + dcacb62 commit 92ffcce

11 files changed

Lines changed: 2794 additions & 141 deletions

File tree

.github/workflows/link-checker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ jobs:
3333
env:
3434
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
3535
with:
36-
args: "--no-progress --max-concurrency 8 --accept 200,429 --exclude-path root/llms.txt --exclude-path root/llms-full.txt --exclude-path root/llms-small.txt --exclude-loopback --require-https --exclude sample.duendesoftware.com --exclude docs.duendesoftware.com --exclude sitemap --exclude \"https://github.com/DuendeArchive/IdentityModel.AspNetCore/\" --root-dir \"$PWD/root\" root/**"
36+
args: "--no-progress --max-concurrency 8 --skip-missing --accept 200,429 --exclude-path root/llms.txt --exclude-path root/llms-full.txt --exclude-path root/llms-small.txt --exclude-loopback --require-https --exclude sample.duendesoftware.com --exclude docs.duendesoftware.com --exclude sitemap --exclude \"https://github.com/DuendeArchive/IdentityModel.AspNetCore/\" --root-dir \"$PWD/root\" root/**"
3737
fail: true

astro.config.mjs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@ import rehypeAutolinkHeadings from "rehype-autolink-headings";
1111
import starlightHeadingBadges from "starlight-heading-badges";
1212
import starlightLlmsTxt from "starlight-llms-txt";
1313
import rehypeAstroRelativeMarkdownLinks from "astro-rehype-relative-markdown-links";
14+
import opengraphImages from "astro-opengraph-images";
15+
import { duendeOpenGraphImage } from "./src/components/duende-og-image.js";
16+
import * as fs from "node:fs";
1417

1518
// https://astro.build/config
1619
export default defineConfig({
@@ -123,6 +126,7 @@ export default defineConfig({
123126
components: {
124127
SkipLink: "./src/components/SkipLink.astro",
125128
Banner: "./src/components/Banner.astro",
129+
Head: "./src/components/Head.astro",
126130
},
127131
sidebar: [
128132
{
@@ -162,6 +166,21 @@ export default defineConfig({
162166
redirectFrom({
163167
contentDir: "./src/content/docs",
164168
}),
169+
opengraphImages({
170+
options: {
171+
fonts: [
172+
{
173+
name: "Roboto",
174+
weight: 400,
175+
style: "normal",
176+
data: fs.readFileSync(
177+
"node_modules/@fontsource/roboto/files/roboto-latin-400-normal.woff",
178+
),
179+
},
180+
],
181+
},
182+
render: duendeOpenGraphImage,
183+
}),
165184
],
166185
markdown: {
167186
rehypePlugins: [

fix-svg.ps1

Lines changed: 0 additions & 1 deletion
This file was deleted.

fix-svg.sh

Lines changed: 0 additions & 7 deletions
This file was deleted.

0 commit comments

Comments
 (0)