@cedgetec-utils/astro-components 1.0.0 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/Head.astro +13 -14
package/package.json
CHANGED
package/src/Head.astro
CHANGED
|
@@ -8,10 +8,10 @@ type Props = {
|
|
|
8
8
|
description: string | null | undefined;
|
|
9
9
|
keywords: string[] | null | undefined;
|
|
10
10
|
icons: {
|
|
11
|
-
|
|
12
|
-
|
|
11
|
+
light: string | ImageMetadata;
|
|
12
|
+
dark: string | ImageMetadata;
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
image: string | ImageMetadata | null | undefined;
|
|
15
15
|
};
|
|
16
16
|
const props = Astro.props;
|
|
17
17
|
|
|
@@ -23,22 +23,22 @@ const title =
|
|
|
23
23
|
const ogTitle = slug === "" ? props.siteName : `${props.title}`;
|
|
24
24
|
|
|
25
25
|
const iconLight = await getImage({
|
|
26
|
-
src: props.icons.
|
|
26
|
+
src: props.icons.light,
|
|
27
27
|
width: 48,
|
|
28
28
|
height: 48,
|
|
29
29
|
fit: "contain",
|
|
30
30
|
});
|
|
31
31
|
|
|
32
32
|
const iconDark = await getImage({
|
|
33
|
-
src: props.icons.
|
|
33
|
+
src: props.icons.dark,
|
|
34
34
|
width: 48,
|
|
35
35
|
height: 48,
|
|
36
36
|
fit: "contain",
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
-
const openGraphImage = props.
|
|
39
|
+
const openGraphImage = props.image
|
|
40
40
|
? await getImage({
|
|
41
|
-
src: props.
|
|
41
|
+
src: props.image,
|
|
42
42
|
width: 1000,
|
|
43
43
|
height: 500,
|
|
44
44
|
})
|
|
@@ -47,23 +47,22 @@ const openGraphImage = props.imageUrl
|
|
|
47
47
|
|
|
48
48
|
<head>
|
|
49
49
|
<meta charset="UTF-8" />
|
|
50
|
-
<
|
|
51
|
-
|
|
50
|
+
<title>{title}</title>
|
|
51
|
+
|
|
52
52
|
<link rel="icon" href={iconDark.src} />
|
|
53
|
-
<link rel="icon" href={iconDark.src} media="(prefers-color-scheme:light)" />
|
|
54
53
|
<link rel="icon" href={iconLight.src} media="(prefers-color-scheme:dark)" />
|
|
55
|
-
<link rel="icon" href={iconDark.src} />
|
|
54
|
+
<link rel="icon" href={iconDark.src} media="(prefers-color-scheme:light)" />
|
|
55
|
+
|
|
56
56
|
<meta name="generator" content={Astro.generator} />
|
|
57
57
|
<meta name="view-transition" content="same-origin" />
|
|
58
|
-
|
|
59
|
-
<title>{title}</title>
|
|
58
|
+
<meta name="viewport" content="width=device-width" />
|
|
60
59
|
{props.description && <meta name="description" content={props.description} />}
|
|
61
60
|
{
|
|
62
61
|
props.keywords && (
|
|
63
62
|
<meta name="keywords" content={props.keywords.join(",")} />
|
|
64
63
|
)
|
|
65
64
|
}
|
|
66
|
-
|
|
65
|
+
|
|
67
66
|
<meta property="og:title" content={ogTitle} />
|
|
68
67
|
{
|
|
69
68
|
props.description && (
|