From 1d7f69a42b2280e41d28a5048cec7592ec2f99c3 Mon Sep 17 00:00:00 2001 From: Derek Cofausper <256792747+decofe@users.noreply.github.com> Date: Sat, 2 May 2026 03:21:32 +0000 Subject: [PATCH] fix: og:image title/description not rendering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit URLSearchParams was encoding %title → %25title before Vocs could replace the placeholder with the actual page title. Build the query string manually so the %title and %description placeholders survive intact for Vocs substitution. Co-authored-by: Amp Amp-Thread-ID: https://ampcode.com/threads/T-019de67d-9b8f-73f8-90e3-e9a6c7c5c0f4 --- vocs.config.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/vocs.config.ts b/vocs.config.ts index b7fb2ebc..9da48202 100644 --- a/vocs.config.ts +++ b/vocs.config.ts @@ -102,14 +102,12 @@ export default defineConfig({ ? secondSeg.toUpperCase().replace(/-/g, ' ') : '' - const params = new URLSearchParams({ - title: '%title', - description: '%description', + const extra = new URLSearchParams({ section, ...(subsection ? { subsection } : {}), - }) + }).toString() - return `${baseUrl}/api/og?${params.toString()}` + return `${baseUrl}/api/og?title=%title&description=%description&${extra}` }, // TODO: Change back to file paths (`/lockup-light.svg`, `/lockup-dark.svg`) once password protection is removed logoUrl: {