@nekm/svelte-core 1.0.9 → 1.0.11

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 CHANGED
@@ -1,5 +1,4 @@
1
1
  <script lang="ts">
2
- import {assets} from "$app/paths";
3
2
  import {type QueryParams, queryParamsCreate} from "@nekm/core";
4
3
 
5
4
  export interface SeoCanonical {
@@ -9,25 +8,21 @@
9
8
 
10
9
  export interface SeoProps {
11
10
  readonly siteTitle: string;
12
- readonly description: string;
13
11
  readonly pageTitle: string;
14
- readonly siteAndPageTitle?: {
15
- readonly items: ReadonlyArray<string>;
16
- readonly separator?: string;
17
- }
12
+ readonly description: string;
18
13
  readonly icon: string;
19
14
  readonly canonical?: SeoCanonical;
20
15
  readonly next?: SeoCanonical;
21
- readonly baseUrl?: string;
16
+ readonly origin: string;
22
17
  }
23
18
 
24
- const { siteTitle, description, pageTitle, icon, canonical, next, baseUrl, siteAndPageTitle }: SeoProps = $props();
19
+ const { siteTitle, description, pageTitle, icon, canonical, next, origin }: SeoProps = $props();
25
20
 
26
21
  function createCanonical(canonical?: SeoCanonical, includeBaseUrl = false): string | undefined {
27
22
  let url;
28
23
 
29
24
  if (canonical || includeBaseUrl) {
30
- url = baseUrl ?? assets;
25
+ url = origin;
31
26
  }
32
27
 
33
28
  if (canonical?.path) {
@@ -52,14 +47,10 @@
52
47
  $effect(() => {
53
48
  nextUrl = createCanonical(next);
54
49
  });
55
-
56
- const metaTitle = !siteAndPageTitle
57
- ? `${siteTitle} - ${siteTitle}`
58
- : siteAndPageTitle.items.join(siteAndPageTitle.separator ?? "-");
59
50
  </script>
60
51
 
61
52
  <svelte:head>
62
- <title>{metaTitle}</title>
53
+ <title>{pageTitle} | {siteTitle}</title>
63
54
  <meta name="description" content={description} />
64
55
  <link rel="canonical" href={canonicalUrl} />
65
56
 
@@ -5,16 +5,12 @@ export interface SeoCanonical {
5
5
  }
6
6
  export interface SeoProps {
7
7
  readonly siteTitle: string;
8
- readonly description: string;
9
8
  readonly pageTitle: string;
10
- readonly siteAndPageTitle?: {
11
- readonly items: ReadonlyArray<string>;
12
- readonly separator?: string;
13
- };
9
+ readonly description: string;
14
10
  readonly icon: string;
15
11
  readonly canonical?: SeoCanonical;
16
12
  readonly next?: SeoCanonical;
17
- readonly baseUrl?: string;
13
+ readonly origin: string;
18
14
  }
19
15
  declare const Seo: import("svelte").Component<SeoProps, {}, "">;
20
16
  type Seo = ReturnType<typeof Seo>;
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.9",
4
+ "version": "1.0.11",
5
5
  "scripts": {
6
6
  "dev": "vite dev",
7
7
  "build": "vite build && npm run prepack",