Skip to content

Commit 9174bd4

Browse files
committed
warning when using SVG open graph image
1 parent e93d11a commit 9174bd4

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

docs/tutorialkit.dev/src/content/docs/reference/configuration.mdx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -404,6 +404,25 @@ type TemplateType = "html" | "node" | "angular-cli" | "create-react-app" | "java
404404
405405
```
406406

407+
### `meta`
408+
409+
**type**: `MetaTagsSchema`
410+
411+
Configures `<meta>` tags for Open Graph protocole and Twitter.
412+
<PropertyTable inherited type="MetaTagsSchema" />
413+
414+
Example value:
415+
```yaml
416+
meta:
417+
image: /cover.png
418+
title: Title shown on social media and search engines
419+
description: Description shown on social media and search engines
420+
```
421+
422+
TutorialKit will use your logo as the default image.
423+
If your logo uses the SVG format, it may not display on most social platforms.
424+
Use a raster format instead, such as WEBP or PNG.
425+
407426
## Configure the Tutorialkit Astro integration
408427

409428
`@tutorialkit/astro` is an integration for Astro. You can configure the integration in your `astro.config.ts` file.

packages/astro/src/default/components/MetaTags.astro

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ if (meta.image) {
1515
}
1616
}
1717
imageUrl ??= readLogoFile('logo', true);
18+
if (imageUrl?.endsWith('.svg')) {
19+
console.warn(`Using a SVG open graph image "${imageUrl}". This is not supported by most social platforms.
20+
You should rather set "meta.image" to a raster image (PNG, WEBP).`);
21+
}
1822
---
1923

2024
<meta charset="UTF-8" />

0 commit comments

Comments
 (0)