@nekm/svelte-core 1.0.12 → 1.0.13

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.
Files changed (2) hide show
  1. package/dist/seo.svelte +9 -4
  2. package/package.json +2 -2
package/dist/seo.svelte CHANGED
@@ -1,5 +1,5 @@
1
1
  <script lang="ts">
2
- import {type QueryParams, queryParamsCreate} from "@nekm/core";
2
+ import {type QueryParams, queryParamsCreate, strTrimEnd} from "@nekm/core";
3
3
 
4
4
  export interface SeoCanonical {
5
5
  readonly path?: string;
@@ -44,6 +44,11 @@
44
44
  return url;
45
45
  }
46
46
 
47
+ // Starts with http or https. I.e, is an absolute URL.
48
+ const iconHref = !icon.href.match(/^https?:\/\//ig)
49
+ ? `${strTrimEnd(origin, "/")}/${icon.href}`
50
+ : icon.href;
51
+
47
52
  let canonicalUrl = $state(createCanonical(canonical, true));
48
53
  let nextUrl = $state(createCanonical(next));
49
54
 
@@ -68,8 +73,8 @@
68
73
  <meta property="og:site_name" content={siteTitle} />
69
74
  <meta property="og:title" content={pageTitle} />
70
75
  <meta property="og:description" content={description} />
71
- <meta property="og:image" content={icon.href} />
72
- <meta property="og:image:secure_url" content={icon.href} />
76
+ <meta property="og:image" content={iconHref} />
77
+ <meta property="og:image:secure_url" content={iconHref} />
73
78
  <meta property="og:image:width" content={"" + icon.width} />
74
79
  <meta property="og:image:height" content={"" + icon.height} />
75
80
  <meta property="og:image:type" content={icon.mimeContentType} />
@@ -80,6 +85,6 @@
80
85
  <meta name="twitter:card" content="summary_large_image">
81
86
  <meta name="twitter:title" content={pageTitle} />
82
87
  <meta name="twitter:description" content={description} />
83
- <meta name="twitter:image" content={icon.href} />
88
+ <meta name="twitter:image" content={iconHref} />
84
89
  <meta name="twitter:creator" content="@iamBraska" />
85
90
  </svelte:head>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@nekm/svelte-core",
3
3
  "description": "Code I find myself re-writing over-and-over, Svelte edition.",
4
- "version": "1.0.12",
4
+ "version": "1.0.13",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
7
7
  "build": "vite build && npm run prepack",
@@ -47,6 +47,6 @@
47
47
  "svelte"
48
48
  ],
49
49
  "dependencies": {
50
- "@nekm/core": "^1.0.0"
50
+ "@nekm/core": "^1.0.1"
51
51
  }
52
52
  }