Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ const website: WebSite = {

### Real-world examples

Below are common patterns for using `schema-dts` types when building JSON-LD
for real websites.
Below are common patterns for using `schema-dts` types when building JSON-LD for
real websites.

#### Organization and WebSite (every site should have these)

Expand All @@ -162,10 +162,7 @@ const org: WithContext<Organization> = {
name: 'Acme Corp',
url: 'https://acme.com',
logo: 'https://acme.com/logo.png',
sameAs: [
'https://twitter.com/acme',
'https://www.linkedin.com/company/acme',
],
sameAs: ['https://twitter.com/acme', 'https://www.linkedin.com/company/acme'],
};

const site: WithContext<WebSite> = {
Expand Down Expand Up @@ -254,8 +251,8 @@ const article: WithContext<Article> = {

#### Injecting JSON-LD into HTML

When serializing JSON-LD for injection into a `<script>` tag, escape
characters that could break out of the tag or enable XSS:
When serializing JSON-LD for injection into a `<script>` tag, escape characters
that could break out of the tag or enable XSS:

```ts
function safeJsonLd(data: WithContext<Thing>): string {
Expand Down
12 changes: 6 additions & 6 deletions examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ function safeJsonLd(data: object): string {

## Svelte — `<svelte:head>`

Svelte lets you inject into `<head>` with `<svelte:head>`. Use the same
escaping pattern.
Svelte lets you inject into `<head>` with `<svelte:head>`. Use the same escaping
pattern.

```svelte
<script lang="ts">
Expand Down Expand Up @@ -161,10 +161,10 @@ document.head.appendChild(script);

## Other tooling

Some projects also pair `schema-dts` with tooling that either injects JSON-LD
at build time or generates custom Schema.org-compatible typings:
Some projects also pair `schema-dts` with tooling that either injects JSON-LD at
build time or generates custom Schema.org-compatible typings:

- [**agentmarkup**](https://github.com/agentmarkup/agentmarkup) — Vite and
Astro plugins for automatic JSON-LD injection and validation.
- [**agentmarkup**](https://github.com/agentmarkup/agentmarkup) — Vite and Astro
plugins for automatic JSON-LD injection and validation.
- [**schema-dts-gen**](https://www.npmjs.com/package/schema-dts-gen) — Generate
custom typings from any Schema.org–compatible ontology.
Loading