svelte-meta-tags 1.2.2 → 2.2.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,34 @@
1
+ # [2.2.0](https://github.com/oekazuma/svelte-meta-tags/compare/v2.1.0...v2.2.0) (2021-12-17)
2
+
3
+ ### Features
4
+
5
+ - improved Twitter's CardType type definition ([13b11fd](https://github.com/oekazuma/svelte-meta-tags/commit/13b11fd2e9f6625e1cd0802e825f312f37988666))
6
+
7
+ # [2.1.0](https://github.com/oekazuma/svelte-meta-tags/compare/v2.0.0...v2.1.0) (2021-11-04)
8
+
9
+ ### Features
10
+
11
+ - allow title to be dynamically changed ([b9acefb](https://github.com/oekazuma/svelte-meta-tags/commit/b9acefbea7c64b5434837ffecc17423dcf0ce2d3))
12
+
13
+ # [2.0.0](https://github.com/oekazuma/svelte-meta-tags/compare/v1.2.2...v2.0.0) (2021-09-18)
14
+
15
+ ### chore
16
+
17
+ - change name the MetaTags export ([d40b535](https://github.com/oekazuma/svelte-meta-tags/commit/d40b535249be8b629ba1034358865aa08993927c))
18
+ - remove jsonLd property from MetaTags component ([a05ae2b](https://github.com/oekazuma/svelte-meta-tags/commit/a05ae2b72a8605253a50249e8f76ee76cbe1411d))
19
+
20
+ ### BREAKING CHANGES
21
+
22
+ - Change the way import is written.
23
+ - Remove jsonLd parameter from MetaTags component.
24
+ Please use the JsonLd component from now on.
25
+
26
+ ## [1.2.2](https://github.com/oekazuma/svelte-meta-tags/compare/v1.2.1...v1.2.2) (2021-09-07)
27
+
28
+ ### Bug Fixes
29
+
30
+ - fix types in package.json ([7be485a](https://github.com/oekazuma/svelte-meta-tags/commit/7be485a880203ce2038ea91768031fbbf66d32b5))
31
+
1
32
  ## [1.2.1](https://github.com/oekazuma/svelte-meta-tags/compare/v1.2.0...v1.2.1) (2021-09-07)
2
33
 
3
34
  ### Bug Fixes
package/MetaTags.svelte CHANGED
@@ -1,5 +1,5 @@
1
1
  <script>
2
- export let title = undefined;
2
+ export let title = '';
3
3
  export let noindex = false;
4
4
  export let nofollow = false;
5
5
  export let robotsProps = undefined;
@@ -12,7 +12,6 @@
12
12
  export let canonical = undefined;
13
13
  export let additionalMetaTags = undefined;
14
14
  export let additionalLinkTags = undefined;
15
- export let jsonLd = undefined;
16
15
 
17
16
  let robotsParams = '';
18
17
  if (robotsProps) {
@@ -37,18 +36,10 @@
37
36
  notranslate ? ',notranslate' : ''
38
37
  }`;
39
38
  }
40
-
41
- if (typeof jsonLd !== 'undefined') {
42
- console.warn(
43
- '[WARNING]: JSON-LD will soon be completely separated from the <MetaTags/> component and will no longer work. Please import and use `JsonLd`.'
44
- );
45
- }
46
39
  </script>
47
40
 
48
41
  <svelte:head>
49
- {#if title}
50
- <title>{title}</title>
51
- {/if}
42
+ <title>{title}</title>
52
43
 
53
44
  <meta
54
45
  name="robots"
@@ -272,10 +263,4 @@
272
263
  <link {...tag} />
273
264
  {/each}
274
265
  {/if}
275
-
276
- {#if jsonLd}
277
- {@html `<script type="application/ld+json">${
278
- JSON.stringify({ '@context': 'https://schema.org', ...jsonLd }) + '<'
279
- }/script>`}
280
- {/if}
281
266
  </svelte:head>
package/README.md CHANGED
@@ -13,9 +13,11 @@ This library is inspired by [next-seo](https://github.com/garmeeh/next-seo)
13
13
 
14
14
  **Table of Contents**
15
15
 
16
- - [Installing](#installing)
17
- - [Usage](#usage)
16
+ - [Installing](#-installing)
17
+ - [Usage](#-usage)
18
18
  - [Properties](#properties)
19
+ - [Twitter](#twitter)
20
+ - [Facebook](#facebook)
19
21
  - [robotsProps](#robotsprops)
20
22
  - [Alternate](#alternate)
21
23
  - [Additional Meta Tags](#additional-meta-tags)
@@ -37,7 +39,7 @@ This library is inspired by [next-seo](https://github.com/garmeeh/next-seo)
37
39
  - [DataSet](#dataset)
38
40
  - [FAQ](#faq)
39
41
  - [Types Import](#types-import)
40
- - [Types Import Examples](#types-import-examples)
42
+ - [Types Import Examples](#types-import-examples)
41
43
 
42
44
  ### 📦 Installing
43
45
 
@@ -57,7 +59,7 @@ yarn add svelte-meta-tags
57
59
 
58
60
  ```svelte
59
61
  <script>
60
- import MetaTags from 'svelte-meta-tags';
62
+ import { MetaTags } from 'svelte-meta-tags';
61
63
  </script>
62
64
 
63
65
  <MetaTags title="Example Title" description="Example Description." />
@@ -67,7 +69,7 @@ yarn add svelte-meta-tags
67
69
 
68
70
  ```svelte
69
71
  <script>
70
- import MetaTags from 'svelte-meta-tags';
72
+ import { MetaTags } from 'svelte-meta-tags';
71
73
  </script>
72
74
 
73
75
  <MetaTags
@@ -148,7 +150,20 @@ yarn add svelte-meta-tags
148
150
  | `openGraph.article.authors` | string[] | Writers of the article. |
149
151
  | `openGraph.article.section` | string | A high-level section name. E.g. Technology |
150
152
  | `openGraph.article.tags` | string[] | Tag words associated with this article. |
151
- | `jsonLd` | object | Data in `ld+json` format. **NOTE: It will stop working in v2.0.0!** [Details](#json-ld-warning) |
153
+
154
+ #### Twitter
155
+
156
+ Twitter will read the `og:title`, `og:image` and `og:description` tags for their card, this is why `svelte-meta-tags` omits `twitter:title`, `twitter:image` and `twitter:description` so not to duplicate.
157
+
158
+ #### Facebook
159
+
160
+ ```js
161
+ facebook={{
162
+ appId: '1234567890',
163
+ }}
164
+ ```
165
+
166
+ Add this to your SEO config to include the fb:app_id meta if you need to enable Facebook insights for your site. Information regarding this can be found in facebook's [documentation](https://developers.facebook.com/docs/sharing/webmasters/)
152
167
 
153
168
  #### robotsProps
154
169
 
@@ -158,34 +173,35 @@ Example:
158
173
 
159
174
  ```svelte
160
175
  <script>
161
- import MetaTags from 'svelte-meta-tags';
176
+ import { MetaTags } from 'svelte-meta-tags';
162
177
  </script>
163
178
 
164
179
  <MetaTags
165
180
  robotsProps={{
166
- nosnippet: true,
167
- notranslate: true,
168
- noimageindex: true,
169
181
  noarchive: true,
182
+ nosnippet: true,
170
183
  maxSnippet: -1,
171
184
  maxImagePreview: 'none',
172
- maxVideoPreview: -1
185
+ maxVideoPreview: -1,
186
+ notranslate: true,
187
+ noimageindex: true,
188
+ unavailableAfter: '25 Jun 2010 15:00:00 PST'
173
189
  }}
174
190
  />
175
191
  ```
176
192
 
177
193
  **Available properties**
178
194
 
179
- | Property | Type | Description |
180
- | ------------------- | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
181
- | `noarchive` | boolean | Do not show a [cached link](https://support.google.com/websearch/answer/1687222) in search results. |
182
- | `nosnippet` | boolean | Do not show a text snippet or video preview in the search results for this page. |
183
- | `max-snippet` | number | Use a maximum of [number] characters as a textual snippet for this search result. [Read more](https://developers.google.com/search/reference/robots_meta_tag?hl=en-GB#directives) |
184
- | `max-image-preview` | 'none','standard','large' | Set the maximum size of an image preview for this page in a search results. |
185
- | `max-video-preview` | number | Use a maximum of [number] seconds as a video snippet for videos on this page in search results. [Read more](https://developers.google.com/search/reference/robots_meta_tag?hl=en-GB#directives) |
186
- | `notranslate` | boolean | Do not offer translation of this page in search results. |
187
- | `noimageindex` | boolean | Do not index images on this page. |
188
- | `unavailable_after` | string | Do not show this page in search results after the specified date/time. The date/time must be specified in a widely adopted format including, but not limited to RFC 822, RFC 850, and ISO 8601. |
195
+ | Property | Type | Description |
196
+ | ------------------ | ------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
197
+ | `noarchive` | boolean | Do not show a [cached link](https://support.google.com/websearch/answer/1687222) in search results. |
198
+ | `nosnippet` | boolean | Do not show a text snippet or video preview in the search results for this page. |
199
+ | `maxSnippet` | number | Use a maximum of [number] characters as a textual snippet for this search result. [Read more](https://developers.google.com/search/reference/robots_meta_tag?hl=en-GB#directives) |
200
+ | `maxImagePreview` | 'none','standard','large' | Set the maximum size of an image preview for this page in a search results. |
201
+ | `maxVideoPreview` | number | Use a maximum of [number] seconds as a video snippet for videos on this page in search results. [Read more](https://developers.google.com/search/reference/robots_meta_tag?hl=en-GB#directives) |
202
+ | `notranslate` | boolean | Do not offer translation of this page in search results. |
203
+ | `noimageindex` | boolean | Do not index images on this page. |
204
+ | `unavailableAfter` | string | Do not show this page in search results after the specified date/time. The date/time must be specified in a widely adopted format including, but not limited to RFC 822, RFC 850, and ISO 8601. |
189
205
 
190
206
  For more reference about the `X-Robots-Tag` visit [Google Search Central - Control Crawling and Indexing](https://developers.google.com/search/reference/robots_meta_tag?hl=en-GB#directives)
191
207
 
@@ -333,7 +349,7 @@ Svelte Meta Tags currently supports:
333
349
 
334
350
  ```svelte
335
351
  <script>
336
- import MetaTags from 'svelte-meta-tags';
352
+ import { MetaTags } from 'svelte-meta-tags';
337
353
  </script>
338
354
 
339
355
  <MetaTags
@@ -366,7 +382,7 @@ Full info on [http://ogp.me/](http://ogp.me/#type_video)
366
382
 
367
383
  ```svelte
368
384
  <script>
369
- import MetaTags from 'svelte-meta-tags';
385
+ import { MetaTags } from 'svelte-meta-tags';
370
386
  </script>
371
387
 
372
388
  <MetaTags
@@ -409,7 +425,7 @@ Full info on [http://ogp.me/](http://ogp.me/#type_video)
409
425
 
410
426
  ```svelte
411
427
  <script>
412
- import MetaTags from 'svelte-meta-tags';
428
+ import { MetaTags } from 'svelte-meta-tags';
413
429
  </script>
414
430
 
415
431
  <MetaTags
@@ -445,7 +461,7 @@ Full info on [http://ogp.me/](http://ogp.me/#type_video)
445
461
 
446
462
  ```svelte
447
463
  <script>
448
- import MetaTags from 'svelte-meta-tags';
464
+ import { MetaTags } from 'svelte-meta-tags';
449
465
  </script>
450
466
 
451
467
  <MetaTags
@@ -479,7 +495,7 @@ Full info on [http://ogp.me/](http://ogp.me/#type_video)
479
495
 
480
496
  ```svelte
481
497
  <script>
482
- import MetaTags from 'svelte-meta-tags';
498
+ import { MetaTags } from 'svelte-meta-tags';
483
499
  </script>
484
500
 
485
501
  <MetaTags
@@ -514,8 +530,6 @@ To discover all the different content types JSON-LD offers check out: https://de
514
530
 
515
531
  It is also possible to use multiple `<JsonLd />` components in a single page.
516
532
 
517
- **NOTE: In v2.0.0, JSON-LD will be completely separated from the `<MetaTags/>` component. Please use the `<JsonLd/>` component from now on!**
518
-
519
533
  ### Using `schema-dts`
520
534
 
521
535
  This plugin uses [schema-dts](https://github.com/google/schema-dts), so it also provides types other than the usage examples below.
@@ -725,7 +739,7 @@ You can import and use the types `MetaTagsProps` and `JsonLdProps`.
725
739
 
726
740
  ```svelte
727
741
  <script lang="ts">
728
- import MetaTags, { JsonLd, MetaTagsProps, JsonLdProps } from 'svelte-meta-tags';
742
+ import { MetaTags, JsonLd, MetaTagsProps, JsonLdProps } from 'svelte-meta-tags';
729
743
 
730
744
  const metatags: MetaTagsProps = {
731
745
  title: 'Types Page Title | Svelte Meta Tags',
package/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- export { default } from './MetaTags.svelte';
1
+ export { default as MetaTags } from './MetaTags.svelte';
2
2
  export { default as JsonLd } from './JsonLd.svelte';
3
3
  export type { MetaTagsProps, JsonLdProps } from './types';
package/index.js CHANGED
@@ -1,2 +1,2 @@
1
- export { default } from './MetaTags.svelte';
1
+ export { default as MetaTags } from './MetaTags.svelte';
2
2
  export { default as JsonLd } from './JsonLd.svelte';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-meta-tags",
3
- "version": "1.2.2",
3
+ "version": "2.2.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",
@@ -25,29 +25,29 @@
25
25
  "schema-dts": "1.0.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@commitlint/cli": "13.1.0",
29
- "@commitlint/config-conventional": "13.1.0",
30
- "@semantic-release/changelog": "5.0.1",
31
- "@semantic-release/git": "9.0.1",
32
- "@sveltejs/kit": "1.0.0-next.164",
33
- "@typescript-eslint/eslint-plugin": "4.31.0",
34
- "@typescript-eslint/parser": "4.31.0",
35
- "cypress": "8.3.1",
36
- "eslint": "7.32.0",
28
+ "@commitlint/cli": "15.0.0",
29
+ "@commitlint/config-conventional": "15.0.0",
30
+ "@semantic-release/changelog": "6.0.1",
31
+ "@semantic-release/git": "10.0.1",
32
+ "@sveltejs/kit": "1.0.0-next.202",
33
+ "@typescript-eslint/eslint-plugin": "5.8.0",
34
+ "@typescript-eslint/parser": "5.8.0",
35
+ "cypress": "9.1.1",
36
+ "eslint": "8.5.0",
37
37
  "eslint-config-prettier": "8.3.0",
38
- "eslint-plugin-cypress": "2.11.3",
39
- "eslint-plugin-svelte3": "3.2.0",
40
- "husky": "7.0.2",
41
- "lint-staged": "11.1.2",
42
- "prettier": "2.3.2",
43
- "prettier-plugin-svelte": "2.4.0",
44
- "semantic-release": "17.4.7",
45
- "svelte": "3.42.4",
46
- "svelte-check": "2.2.5",
47
- "svelte-preprocess": "4.9.2",
48
- "svelte2tsx": "0.4.5",
38
+ "eslint-plugin-cypress": "2.12.1",
39
+ "eslint-plugin-svelte3": "3.2.1",
40
+ "husky": "7.0.4",
41
+ "lint-staged": "12.1.3",
42
+ "prettier": "2.5.1",
43
+ "prettier-plugin-svelte": "2.5.1",
44
+ "semantic-release": "18.0.1",
45
+ "svelte": "3.44.3",
46
+ "svelte-check": "2.2.11",
47
+ "svelte-preprocess": "4.10.1",
48
+ "svelte2tsx": "0.4.12",
49
49
  "tslib": "2.3.1",
50
- "typescript": "4.4.2"
50
+ "typescript": "4.5.4"
51
51
  },
52
52
  "peerDependencies": {
53
53
  "svelte": "^3.39.0"
@@ -89,6 +89,11 @@
89
89
  "main"
90
90
  ]
91
91
  },
92
+ "engines": {
93
+ "npm": "forbidden, use pnpm",
94
+ "pnpm": ">=6",
95
+ "yarn": "forbidden, use pnpm"
96
+ },
92
97
  "exports": {
93
98
  "./package.json": "./package.json",
94
99
  "./JsonLd.svelte": "./JsonLd.svelte",
package/types.d.ts CHANGED
@@ -21,7 +21,7 @@ export interface AdditionalRobotsProps {
21
21
  notranslate?: boolean;
22
22
  }
23
23
  export interface Twitter {
24
- cardType?: string;
24
+ cardType?: 'summary' | 'summary_large_image' | 'app' | 'player';
25
25
  site?: string;
26
26
  handle?: string;
27
27
  }
@@ -97,7 +97,6 @@ interface OpenGraphVideoActors {
97
97
 
98
98
  interface BaseMetaTag {
99
99
  content: string;
100
- keyOverride?: string;
101
100
  }
102
101
 
103
102
  interface HTML5MetaTag extends BaseMetaTag {
@@ -131,7 +130,6 @@ export interface LinkTag {
131
130
  sizes?: string;
132
131
  type?: string;
133
132
  color?: string;
134
- keyOverride?: string;
135
133
  }
136
134
 
137
135
  export interface MetaTagsProps {
@@ -148,9 +146,8 @@ export interface MetaTagsProps {
148
146
  openGraph?: OpenGraph;
149
147
  additionalMetaTags?: ReadonlyArray<MetaTag>;
150
148
  additionalLinkTags?: ReadonlyArray<LinkTag>;
151
- jsonLd?: Thing | WithContext<Thing>;
152
149
  }
153
150
 
154
151
  export interface JsonLdProps {
155
- schema: Thing | WithContext<Thing>;
152
+ schema?: Thing | WithContext<Thing>;
156
153
  }