From 925f695503662f8a684ceb8140c173b32ccd389c Mon Sep 17 00:00:00 2001 From: Jay V Date: Wed, 2 Jul 2025 18:44:01 -0400 Subject: docs: tweak styles --- packages/web/src/components/Head.astro | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'packages/web/src/components') diff --git a/packages/web/src/components/Head.astro b/packages/web/src/components/Head.astro index 36f11c955..3d9bc0f53 100644 --- a/packages/web/src/components/Head.astro +++ b/packages/web/src/components/Head.astro @@ -7,13 +7,14 @@ import config from '../../config.mjs' const slug = Astro.url.pathname.replace(/^\//, "").replace(/\/$/, ""); const { entry: { - data: { title }, + data: { title , description }, }, } = Astro.locals.starlightRoute; const isDocs = slug.startsWith("docs") let encodedTitle = ''; let ogImage = `${config.url}/social-share.png`; +let truncatedDesc = ''; if (isDocs) { // Truncate to fit S3's max key size @@ -26,7 +27,12 @@ if (isDocs) { ) ) ); - ogImage = `${config.socialCard}/opencode-docs/${encodedTitle}.png`; + + if (description) { + truncatedDesc = encodeURIComponent(description.substring(0, 400)) + } + + ogImage = `${config.socialCard}/opencode-docs/${encodedTitle}.png?desc=${truncatedDesc}`; } --- -- cgit v1.2.3