Skip to content

Commit 8e25ca3

Browse files
committed
docs: update support contact and og icon
1 parent e0b2a81 commit 8e25ca3

3 files changed

Lines changed: 29 additions & 15 deletions

File tree

docs/.vitepress/og-image.mts

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ const BACKGROUND = "#ffffff";
2424
const FOOTER_BORDER = "#e2e8f0";
2525

2626
const SITE_HOSTNAME = "simdeck.nativescript.org";
27+
const SIMDECK_ICON_URL = new URL(
28+
"../../client/public/simdeck.png",
29+
import.meta.url,
30+
);
2731

2832
type SatoriElement = {
2933
type: string;
@@ -61,6 +65,7 @@ let fontsPromise:
6165
Array<{ name: string; data: Buffer; weight: 400 | 700; style: "normal" }>
6266
>
6367
| undefined;
68+
let iconDataUrlPromise: Promise<string> | undefined;
6469

6570
async function loadFonts() {
6671
if (!fontsPromise) {
@@ -92,21 +97,30 @@ async function loadFonts() {
9297
return fontsPromise;
9398
}
9499

95-
function buildTemplate({
96-
title,
97-
description,
98-
category,
99-
}: OgPageInfo): SatoriElement {
100+
async function loadIconDataUrl() {
101+
if (!iconDataUrlPromise) {
102+
iconDataUrlPromise = fs
103+
.readFile(SIMDECK_ICON_URL)
104+
.then((icon) => `data:image/png;base64,${icon.toString("base64")}`);
105+
}
106+
return iconDataUrlPromise;
107+
}
108+
109+
function buildTemplate(
110+
{ title, description, category }: OgPageInfo,
111+
iconSrc: string,
112+
): SatoriElement {
100113
const topRowChildren: SatoriChildren = [
101114
el("div", { style: { display: "flex", alignItems: "center" } }, [
102-
el("div", {
115+
el("img", {
116+
src: iconSrc,
117+
alt: "SimDeck icon",
103118
style: {
104-
width: "44px",
105-
height: "44px",
106-
borderRadius: "10px",
107-
background: `linear-gradient(135deg, ${BRAND_BLUE} 0%, #4ba3ff 100%)`,
119+
width: "48px",
120+
height: "48px",
121+
borderRadius: "12px",
108122
marginRight: "18px",
109-
display: "flex",
123+
display: "block",
110124
},
111125
}),
112126
el(
@@ -244,8 +258,8 @@ function buildTemplate({
244258
}
245259

246260
export async function renderOgImage(info: OgPageInfo): Promise<Buffer> {
247-
const fonts = await loadFonts();
248-
const svg = await satori(buildTemplate(info) as unknown as never, {
261+
const [fonts, iconSrc] = await Promise.all([loadFonts(), loadIconDataUrl()]);
262+
const svg = await satori(buildTemplate(info, iconSrc) as unknown as never, {
249263
width: WIDTH,
250264
height: HEIGHT,
251265
fonts,

docs/support.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Need help with SimDeck Studio, the SimDeck CLI, browser streaming, pairing, or s
99

1010
## Contact
1111

12-
Email [support@nstudio.io](mailto:support@nstudio.io) for app issues, setup questions, general feedback, and feature requests.
12+
Email [support@nativescript.org](mailto:support@nativescript.org) for app issues, setup questions, general feedback, and feature requests.
1313

1414
## What To Include
1515

ios/PRIVACY.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,4 @@ If SimDeck's privacy practices change, we will update this policy and revise the
4242

4343
## Contact
4444

45-
If you have questions about this privacy policy, contact us at support@nstudio.io.
45+
If you have questions about this privacy policy, contact us at support@nativescript.org.

0 commit comments

Comments
 (0)