mirror of
https://github.com/sst/opencode.git
synced 2025-08-04 13:30:52 +00:00
docs: share page many model case
This commit is contained in:
parent
00ea5082e7
commit
4d6ca3fab1
2 changed files with 13 additions and 1 deletions
|
@ -57,6 +57,7 @@
|
|||
display: flex;
|
||||
gap: 0.5rem 0.875rem;
|
||||
flex-wrap: wrap;
|
||||
max-width: var(--lg-tool-width);
|
||||
|
||||
[data-slot="item"] {
|
||||
display: flex;
|
||||
|
|
|
@ -38,8 +38,19 @@ const encodedTitle = encodeURIComponent(
|
|||
)
|
||||
);
|
||||
|
||||
const ogImage = `${config.socialCard}/opencode-share/${encodedTitle}.png?model=${Array.from(models).join(",")}&version=${version}&id=${id}`;
|
||||
const modelsArray = Array.from(models);
|
||||
let modelParam;
|
||||
if (modelsArray.length === 1) {
|
||||
modelParam = modelsArray[0];
|
||||
}
|
||||
else if (modelsArray.length === 2) {
|
||||
modelParam = `${modelsArray[0]} & ${modelsArray[1]}`;
|
||||
}
|
||||
else {
|
||||
modelParam = `${modelsArray[0]} & ${modelsArray.length - 1} others`;
|
||||
}
|
||||
|
||||
const ogImage = `${config.socialCard}/opencode-share/${encodedTitle}.png?model=${modelParam}&version=${version}&id=${id}`;
|
||||
---
|
||||
<StarlightPage
|
||||
hasSidebar={false}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue