svelte-meta-tags 2.5.0 → 2.5.1

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/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## [2.5.1](https://github.com/oekazuma/svelte-meta-tags/compare/v2.5.0...v2.5.1) (2022-03-22)
2
+
3
+ ### Bug Fixes
4
+
5
+ - fix title to be reactive([a19d30b](https://github.com/oekazuma/svelte-meta-tags/commit/a19d30bad9938d78360aea126012bfd7061fff3f))
6
+
7
+ # [2.5.0](https://github.com/oekazuma/svelte-meta-tags/compare/v2.4.0...v2.5.0) (2022-03-19)
8
+
9
+ ### Features
10
+
11
+ - add titleTemplate property ([3a252e5](https://github.com/oekazuma/svelte-meta-tags/commit/3a252e5783d04456e32539d8bd3ca7646809fd0d))
12
+
1
13
  # [2.4.0](https://github.com/oekazuma/svelte-meta-tags/compare/v2.3.4...v2.4.0) (2022-03-12)
2
14
 
3
15
  ### Features
package/MetaTags.svelte CHANGED
@@ -14,9 +14,7 @@
14
14
  export let additionalMetaTags = undefined;
15
15
  export let additionalLinkTags = undefined;
16
16
 
17
- if (titleTemplate) {
18
- title = titleTemplate.replace(/%s/g, title);
19
- }
17
+ $: updatedTitle = titleTemplate ? titleTemplate.replace(/%s/g, title) : title;
20
18
 
21
19
  let robotsParams = '';
22
20
  if (robotsProps) {
@@ -44,7 +42,7 @@
44
42
  </script>
45
43
 
46
44
  <svelte:head>
47
- <title>{title}</title>
45
+ <title>{updatedTitle}</title>
48
46
 
49
47
  <meta
50
48
  name="robots"
@@ -216,8 +214,8 @@
216
214
  {/if}
217
215
  {/if}
218
216
 
219
- {#if openGraph.title || title}
220
- <meta property="og:title" content={openGraph.title || title} />
217
+ {#if openGraph.title || updatedTitle}
218
+ <meta property="og:title" content={openGraph.title || updatedTitle} />
221
219
  {/if}
222
220
 
223
221
  {#if openGraph.description || description}
package/README.md CHANGED
@@ -20,6 +20,7 @@ This library is inspired by [next-seo](https://github.com/garmeeh/next-seo)
20
20
  - [Installing](#-installing)
21
21
  - [Usage](#-usage)
22
22
  - [MetaTags Properties](#metatags-properties)
23
+ - [Title Template](#title-template)
23
24
  - [Twitter](#twitter)
24
25
  - [Facebook](#facebook)
25
26
  - [robotsProps](#robotsprops)
@@ -85,6 +86,7 @@ pnpm add -D svelte-meta-tags
85
86
 
86
87
  <MetaTags
87
88
  title="Using More of Config"
89
+ titleTemplate="%s | Svelte Meta Tags"
88
90
  description="This example uses more of the available config options."
89
91
  canonical="https://www.canonical.ie/"
90
92
  openGraph={{
@@ -175,15 +177,15 @@ pnpm add -D svelte-meta-tags
175
177
 
176
178
  Replaces `%s` with your title string
177
179
 
178
- ```js
179
- title = 'This is my title';
180
- titleTemplate = 'Svelte Meta Tags | %s';
180
+ ```
181
+ title = 'This is my title'
182
+ titleTemplate = 'Svelte Meta Tags | %s'
181
183
  // outputs: Svelte Meta Tags | This is my title
182
184
  ```
183
185
 
184
- ```js
185
- title = 'This is my title';
186
- titleTemplate = '%s | Svelte Meta Tags';
186
+ ```
187
+ title = 'This is my title'
188
+ titleTemplate = '%s | Svelte Meta Tags'
187
189
  // outputs: This is my title | Svelte Meta Tags
188
190
  ```
189
191
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-meta-tags",
3
- "version": "2.5.0",
3
+ "version": "2.5.1",
4
4
  "description": "Svelte Meta Tags is a plugin that makes managing your SEO easier in Svelte projects.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -27,8 +27,8 @@
27
27
  "@semantic-release/git": "10.0.1",
28
28
  "@sveltejs/adapter-auto": "1.0.0-next.33",
29
29
  "@sveltejs/kit": "1.0.0-next.301",
30
- "@typescript-eslint/eslint-plugin": "5.15.0",
31
- "@typescript-eslint/parser": "5.15.0",
30
+ "@typescript-eslint/eslint-plugin": "5.16.0",
31
+ "@typescript-eslint/parser": "5.16.0",
32
32
  "cypress": "9.5.2",
33
33
  "eslint": "8.11.0",
34
34
  "eslint-config-prettier": "8.5.0",
@@ -93,4 +93,4 @@
93
93
  ".": "./index.js"
94
94
  },
95
95
  "svelte": "./index.js"
96
- }
96
+ }