mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-02 22:40:22 +00:00
docs: tweak styles
This commit is contained in:
parent
f1c925795d
commit
925f695503
11 changed files with 52 additions and 18 deletions
|
|
@ -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}`;
|
||||
}
|
||||
---
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue