@cedgetec-utils/astro-components 0.2.0 → 1.1.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/index.ts CHANGED
@@ -1,9 +1,7 @@
1
1
  // Do not write code directly here, instead use the `src` folder!
2
2
  // Then, use this file to export everything you want your user to access.
3
3
 
4
- export {
5
- default as DirectusImage,
6
- type DirectusImageData,
7
- } from "./src/DirectusImage.astro";
4
+ export { default as DirectusImage } from "./src/DirectusImage.astro";
5
+ export type { DirectusImageData } from "./src/DirectusImage.astro";
8
6
  export { default as Head } from "./src/Head.astro";
9
7
  export { default as Matomo } from "./src/Matomo.astro";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cedgetec-utils/astro-components",
3
- "version": "0.2.0",
3
+ "version": "1.1.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./index.ts"
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
- lightUrl: string;
12
- darkUrl: string;
11
+ light: string | ImageMetadata;
12
+ dark: string | ImageMetadata;
13
13
  };
14
- imageUrl: string | null | undefined;
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.lightUrl,
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.darkUrl,
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.imageUrl
39
+ const openGraphImage = props.image
40
40
  ? await getImage({
41
- src: props.imageUrl,
41
+ src: props.image,
42
42
  width: 1000,
43
43
  height: 500,
44
44
  })
@@ -50,9 +50,8 @@ const openGraphImage = props.imageUrl
50
50
  <meta name="viewport" content="width=device-width" />
51
51
  <!-- Icons -->
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)" />
56
55
  <meta name="generator" content={Astro.generator} />
57
56
  <meta name="view-transition" content="same-origin" />
58
57
  <!-- Title etc. -->