aboutsummaryrefslogtreecommitdiff
path: root/src/components/JsonLd.astro
blob: d12cb7847462545760eb2421f7b5c119d7fec1f5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
---
import type { Thing } from "schema-dts";

type Props = {
	readonly schema: Thing[];
};

const { schema } = Astro.props;

const payload = {
	"@context": "https://schema.org",
	"@graph": schema,
};

const json = JSON.stringify(payload);
---

<!-- JSON-LD -->
<script is:inline type="application/ld+json" set:html={json} />