@nekm/svelte-core 1.0.7 → 1.0.9
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/google-analytics.d.ts +1 -1
- package/dist/google-analytics.js +2 -2
- package/dist/seo.svelte +16 -8
- package/dist/seo.svelte.d.ts +6 -2
- package/package.json +2 -1
package/dist/google-analytics.js
CHANGED
package/dist/seo.svelte
CHANGED
|
@@ -8,16 +8,20 @@
|
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export interface SeoProps {
|
|
11
|
-
readonly
|
|
11
|
+
readonly siteTitle: string;
|
|
12
12
|
readonly description: string;
|
|
13
|
-
readonly
|
|
13
|
+
readonly pageTitle: string;
|
|
14
|
+
readonly siteAndPageTitle?: {
|
|
15
|
+
readonly items: ReadonlyArray<string>;
|
|
16
|
+
readonly separator?: string;
|
|
17
|
+
}
|
|
14
18
|
readonly icon: string;
|
|
15
19
|
readonly canonical?: SeoCanonical;
|
|
16
20
|
readonly next?: SeoCanonical;
|
|
17
21
|
readonly baseUrl?: string;
|
|
18
22
|
}
|
|
19
23
|
|
|
20
|
-
const {
|
|
24
|
+
const { siteTitle, description, pageTitle, icon, canonical, next, baseUrl, siteAndPageTitle }: SeoProps = $props();
|
|
21
25
|
|
|
22
26
|
function createCanonical(canonical?: SeoCanonical, includeBaseUrl = false): string | undefined {
|
|
23
27
|
let url;
|
|
@@ -48,10 +52,14 @@
|
|
|
48
52
|
$effect(() => {
|
|
49
53
|
nextUrl = createCanonical(next);
|
|
50
54
|
});
|
|
55
|
+
|
|
56
|
+
const metaTitle = !siteAndPageTitle
|
|
57
|
+
? `${siteTitle} - ${siteTitle}`
|
|
58
|
+
: siteAndPageTitle.items.join(siteAndPageTitle.separator ?? "-");
|
|
51
59
|
</script>
|
|
52
60
|
|
|
53
61
|
<svelte:head>
|
|
54
|
-
<title>{
|
|
62
|
+
<title>{metaTitle}</title>
|
|
55
63
|
<meta name="description" content={description} />
|
|
56
64
|
<link rel="canonical" href={canonicalUrl} />
|
|
57
65
|
|
|
@@ -59,20 +67,20 @@
|
|
|
59
67
|
<link rel="next" href={nextUrl} />
|
|
60
68
|
{/if}
|
|
61
69
|
|
|
62
|
-
<meta property="og:site_name" content={
|
|
63
|
-
<meta property="og:title" content={
|
|
70
|
+
<meta property="og:site_name" content={siteTitle} />
|
|
71
|
+
<meta property="og:title" content={pageTitle} />
|
|
64
72
|
<meta property="og:description" content={description} />
|
|
65
73
|
<meta property="og:image" content={icon} />
|
|
66
74
|
<meta property="og:image:secure_url" content={icon} />
|
|
67
75
|
<meta property="og:image:width" content="1024" />
|
|
68
76
|
<meta property="og:image:height" content="1024" />
|
|
69
77
|
<meta property="og:image:type" content="image/png" />
|
|
70
|
-
<meta property="og:image:alt" content={`${
|
|
78
|
+
<meta property="og:image:alt" content={`${siteTitle} logo`} />
|
|
71
79
|
<meta property="og:url" content={canonicalUrl} />
|
|
72
80
|
<meta property="og:type" content="website" />
|
|
73
81
|
|
|
74
82
|
<meta name="twitter:card" content="summary_large_image">
|
|
75
|
-
<meta name="twitter:title" content={
|
|
83
|
+
<meta name="twitter:title" content={pageTitle} />
|
|
76
84
|
<meta name="twitter:description" content={description} />
|
|
77
85
|
<meta name="twitter:image" content={icon} />
|
|
78
86
|
<meta name="twitter:creator" content="@iamBraska" />
|
package/dist/seo.svelte.d.ts
CHANGED
|
@@ -4,9 +4,13 @@ export interface SeoCanonical {
|
|
|
4
4
|
readonly queryParams?: QueryParams;
|
|
5
5
|
}
|
|
6
6
|
export interface SeoProps {
|
|
7
|
-
readonly
|
|
7
|
+
readonly siteTitle: string;
|
|
8
8
|
readonly description: string;
|
|
9
|
-
readonly
|
|
9
|
+
readonly pageTitle: string;
|
|
10
|
+
readonly siteAndPageTitle?: {
|
|
11
|
+
readonly items: ReadonlyArray<string>;
|
|
12
|
+
readonly separator?: string;
|
|
13
|
+
};
|
|
10
14
|
readonly icon: string;
|
|
11
15
|
readonly canonical?: SeoCanonical;
|
|
12
16
|
readonly next?: SeoCanonical;
|
package/package.json
CHANGED