diff --git a/src/pages/open-graph/[...route].ts b/src/pages/open-graph/[...route].ts index 4fcf37f..de43b6d 100644 --- a/src/pages/open-graph/[...route].ts +++ b/src/pages/open-graph/[...route].ts @@ -1,6 +1,6 @@ import { OGImageRoute } from "astro-og-canvas"; import { config } from "../../../config"; -import { getSortedDocs } from "src/utils"; +import { getSortedDocs, getTitle } from "src/utils"; const posts = await getSortedDocs(); @@ -10,15 +10,12 @@ const posts = await getSortedDocs(); const pages = posts.reduce( (acc, post) => { acc[post.id] = { - title: "", + title: getTitle(post) ?? "", description: post.data.description ?? "", }; return acc; }, - {} as Record< - string, - { title: string; description: string; customOGImage?: string } - >, + {} as Record, ); export const { getStaticPaths, GET } = OGImageRoute({ @@ -31,8 +28,8 @@ export const { getStaticPaths, GET } = OGImageRoute({ // In this example, we generate one image at `/open-graph/example.png`. pages: { main: { - title: config.SITE_NAME, - description: config.SITE_DESCRIPTION, + title: config.SITE_NAME ?? "hello", + description: config.SITE_DESCRIPTION ?? "", }, ...pages, }, @@ -42,9 +39,7 @@ export const { getStaticPaths, GET } = OGImageRoute({ title: page.title, description: page.description, bgImage: { - path: page.customOGImage - ? "." + page.customOGImage - : "./src/assets/backgrounds/background.jpg", + path: "./src/assets/backgrounds/background.jpg", fit: "cover", }, font: { -- knotmirror 0.0.1 From 9825feeac316d77ca35146a1cc568933e6ce7802 Mon Sep 17 00:00:00 2001 From: Florian <45694132+flo-bit@users.noreply.github.com> Date: Sun, 26 Oct 2025 21:44:26 +0100 Subject: [PATCH 2/2] fix --- .github/workflows/tiny-docs.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/tiny-docs.yml b/.github/workflows/tiny-docs.yml index cbaadf7..d9e5d94 100644 --- a/.github/workflows/tiny-docs.yml +++ b/.github/workflows/tiny-docs.yml @@ -79,10 +79,10 @@ jobs: NAME='${{ steps.derive.outputs.name }}' if command -v jq >/dev/null 2>&1; then - jq -n --arg site "$SITE" --arg base "$BASE" --arg name "$NAME" \ + jq -n --arg SITE "$SITE" --arg BASE "$BASE" --arg SITE_NAME "$NAME" \ '{site:$site, base:$base, name:$name}' > docs/config.json else - printf '{\n "site": "%s",\n "base": "%s",\n "name": "%s"\n}\n' \ + printf '{\n "SITE": "%s",\n "BASE": "%s",\n "SITE_NAME": "%s"\n}\n' \ "$SITE" "$BASE" "$NAME" > docs/config.json fi echo "Created docs/config.json, site=$SITE, base=$BASE, name=$NAME"