seemore 1.12.22 → 1.12.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.js +10 -8
- package/dist/cli/index.js.map +1 -1
- package/package.json +2 -1
package/dist/cli/index.js
CHANGED
|
@@ -2433,6 +2433,7 @@ async function loadPrerenderModule(ctx, ssrOutDir) {
|
|
|
2433
2433
|
// src/node/social/cards.ts
|
|
2434
2434
|
import { mkdirSync as mkdirSync2, writeFileSync as writeFileSync6 } from "fs";
|
|
2435
2435
|
import { dirname as dirname9, join as join11 } from "path";
|
|
2436
|
+
import { createElement } from "react";
|
|
2436
2437
|
|
|
2437
2438
|
// src/shared/og.ts
|
|
2438
2439
|
function ogImagePath(url) {
|
|
@@ -2463,8 +2464,13 @@ async function generateSocialCards(ctx, outDir) {
|
|
|
2463
2464
|
return written;
|
|
2464
2465
|
}
|
|
2465
2466
|
async function renderCard(takumi, site, title, description) {
|
|
2466
|
-
const
|
|
2467
|
-
|
|
2467
|
+
const children = [
|
|
2468
|
+
createElement("div", { style: { fontSize: 28, opacity: 0.6 } }, site),
|
|
2469
|
+
createElement("div", { style: { fontSize: 64, fontWeight: 700 } }, title),
|
|
2470
|
+
...typeof description === "string" ? [createElement("div", { style: { fontSize: 30, opacity: 0.8 } }, description)] : []
|
|
2471
|
+
];
|
|
2472
|
+
const node = createElement(
|
|
2473
|
+
"div",
|
|
2468
2474
|
{
|
|
2469
2475
|
style: {
|
|
2470
2476
|
width: 1200,
|
|
@@ -2478,13 +2484,9 @@ async function renderCard(takumi, site, title, description) {
|
|
|
2478
2484
|
gap: 24
|
|
2479
2485
|
}
|
|
2480
2486
|
},
|
|
2481
|
-
|
|
2482
|
-
takumi.text(site, { style: { fontSize: 28, opacity: 0.6 } }),
|
|
2483
|
-
takumi.text(title, { style: { fontSize: 64, fontWeight: 700 } }),
|
|
2484
|
-
...typeof description === "string" ? [takumi.text(description, { style: { fontSize: 30, opacity: 0.8 } })] : []
|
|
2485
|
-
]
|
|
2487
|
+
children
|
|
2486
2488
|
);
|
|
2487
|
-
return await
|
|
2489
|
+
return await takumi.render(node, { width: 1200, height: 630 });
|
|
2488
2490
|
}
|
|
2489
2491
|
async function importOptional(specifier) {
|
|
2490
2492
|
return await import(specifier);
|