File tree 2 files changed +14
-3
lines changed
docs/tutorialkit.dev/src/content/docs/reference
packages/astro/src/default/components
2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -430,6 +430,7 @@ type DownloadAsZip =
430
430
431
431
Configures `<meta>` tags for Open Graph protocole and Twitter.
432
432
TutorialKit will use your logo as the default image.
433
+ Relative paths are resolved to `public` directory.
433
434
<PropertyTable inherited type="MetaTagsSchema" />
434
435
435
436
The `MetaTagsSchema` type has the following shape :
@@ -449,6 +450,13 @@ meta:
449
450
image: /cover.png
450
451
title: Title shown on social media and search engines
451
452
description: Description shown on social media and search engines
453
+
454
+ meta:
455
+ image: /cover.png # Resolves to public/cover.png
456
+
457
+ meta:
458
+ image: 'https://tutorialkit.dev/tutorialkit-opengraph.png' # URL is used as is
459
+
452
460
` ` `
453
461
454
462
:::tip
Original file line number Diff line number Diff line change @@ -7,13 +7,16 @@ interface Props {
7
7
meta? : MetaTagsConfig ;
8
8
}
9
9
const { meta = {} } = Astro .props ;
10
- let imageUrl;
11
- if (meta .image ) {
12
- imageUrl = readPublicAsset (meta .image , true );
10
+ let imageUrl = meta .image ;
11
+
12
+ if (imageUrl ?.startsWith (' /' ) || imageUrl ?.startsWith (' .' )) {
13
+ imageUrl = readPublicAsset (imageUrl , true );
14
+
13
15
if (! imageUrl ) {
14
16
console .warn (` Image ${meta .image } not found in "/public" folder ` );
15
17
}
16
18
}
19
+
17
20
imageUrl ?? = readLogoFile (' logo' , true );
18
21
---
19
22
You can’t perform that action at this time.
0 commit comments