/
index.html
47 lines (37 loc) · 1.27 KB
/
index.html
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
38
39
40
41
42
43
44
45
46
47
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://unpkg.com/alpinejs" defer></script>
</head>
<body class="h-screen">
<div class="flex items-center h-full bg-neutral-800">
<div class="relative w-[1200px] h-[600px] overflow-hidden mx-auto bg-white" x-data="openGraphImage();">
<!-- Start: Your HTML Template -->
<h1 class="flex items-center justify-center h-full text-3xl font-bold underline">
<span x-text="params.title"></span>
</h1>
<!-- End: Your HTML Template -->
</div>
</div>
<script>
document.addEventListener('alpine:init', () => {
Alpine.data('openGraphImage', () => {
const params = new URLSearchParams(window.location.search);
return {
params: Object.fromEntries(params.entries()),
init() {
window.__og = window.__og || [];
window.__og.push(['link', 'https://www.mywebsite.com']);
this.$nextTick(() => {
window.__og.push(['ready']);
});
},
};
});
});
</script>
</body>
</html>