@nekm/svelte-core 1.9.3 → 1.9.4
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/dist/seo.svelte +6 -8
- package/dist/seo.svelte.d.ts +1 -1
- package/package.json +1 -1
package/dist/seo.svelte
CHANGED
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
|
|
15
15
|
export interface SeoIcon {
|
|
16
16
|
readonly href: string;
|
|
17
|
+
readonly mimeContentType: string;
|
|
17
18
|
readonly height: number;
|
|
18
19
|
readonly width: number;
|
|
19
|
-
readonly mimeContentType: string;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export interface SeoTwitter {
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
description,
|
|
43
43
|
icon,
|
|
44
44
|
additionalIcons = [],
|
|
45
|
-
canonical,
|
|
45
|
+
canonical = { path: page.url.pathname },
|
|
46
46
|
next,
|
|
47
|
-
origin
|
|
47
|
+
origin = page.url.origin,
|
|
48
48
|
twitter,
|
|
49
49
|
}: SeoProps = $props();
|
|
50
50
|
|
|
@@ -52,18 +52,16 @@
|
|
|
52
52
|
if (!canonical.path) return origin;
|
|
53
53
|
|
|
54
54
|
const path = strTrimStart(canonical.path, "/");
|
|
55
|
-
|
|
55
|
+
if (path.length <= 0) return origin;
|
|
56
56
|
|
|
57
|
+
const canonicalWithPath = `${origin}/${path}`;
|
|
57
58
|
if (!canonical.queryParams) return canonicalWithPath;
|
|
58
59
|
|
|
59
60
|
return `${canonicalWithPath}?${queryParamsCreate(canonical.queryParams)}`;
|
|
60
61
|
}
|
|
61
62
|
|
|
62
|
-
const origin = $derived(propsOrigin ?? page.url.origin);
|
|
63
63
|
const iconHref = $derived(urlSetOrigin(origin, icon.href));
|
|
64
|
-
const canonicalUrl = $derived(
|
|
65
|
-
!canonical ? origin : createCanonical(canonical),
|
|
66
|
-
);
|
|
64
|
+
const canonicalUrl = $derived(createCanonical(canonical));
|
|
67
65
|
const nextUrl = $derived(!next ? undefined : createCanonical(next));
|
|
68
66
|
const additionalAppleIcons = $derived(
|
|
69
67
|
additionalIcons.filter((i) => i.mimeContentType === "image/png"),
|
package/dist/seo.svelte.d.ts
CHANGED
|
@@ -5,9 +5,9 @@ export interface SeoCanonical {
|
|
|
5
5
|
}
|
|
6
6
|
export interface SeoIcon {
|
|
7
7
|
readonly href: string;
|
|
8
|
+
readonly mimeContentType: string;
|
|
8
9
|
readonly height: number;
|
|
9
10
|
readonly width: number;
|
|
10
|
-
readonly mimeContentType: string;
|
|
11
11
|
}
|
|
12
12
|
export interface SeoTwitter {
|
|
13
13
|
readonly creator?: string;
|
package/package.json
CHANGED