-
Notifications
You must be signed in to change notification settings - Fork 13
/
compute-html.ts
37 lines (36 loc) · 955 Bytes
/
compute-html.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { config } from "@/config/config";
interface ComputeHtmlParameters {
postType: string;
content: string;
imagePath: string;
}
export const computeHtml = ({
imagePath,
postType,
content,
}: ComputeHtmlParameters) => {
return `<!DOCTYPE html>
<html>
<head>
<title>${content}</title>
<meta property="og:title" content="Thirdweb Frames" />
<meta
property="og:image"
content="https://${config.hostUrl}${imagePath}"
/>
<meta property="fc:frame" content="vNext" />
<meta
property="fc:frame:image"
content="https://${config.hostUrl}${imagePath}"
/>
<meta
property="fc:frame:post_url"
content="https://${config.hostUrl}/api/mint?type=${postType}"
/>
<meta property="fc:frame:button:1" content="${content}" />
</head>
<body>
<p>${content}</p>
</body>
</html>`;
};