svelte-meta-tags 2.3.3 → 2.5.0
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 +18 -0
- package/JsonLd.svelte +8 -1
- package/MetaTags.svelte +5 -0
- package/README.md +27 -2
- package/index.js +2 -7
- package/package.json +14 -14
- package/types.d.ts +2 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,21 @@
|
|
|
1
|
+
# [2.4.0](https://github.com/oekazuma/svelte-meta-tags/compare/v2.3.4...v2.4.0) (2022-03-12)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
- add a property that allows selection of whether to output JSON-LD in the head or in the body ([91c9c38](https://github.com/oekazuma/svelte-meta-tags/commit/91c9c3861d5cc9168a6b3d90c2cf734f5c03f890))
|
|
6
|
+
|
|
7
|
+
## [2.3.4](https://github.com/oekazuma/svelte-meta-tags/compare/v2.3.3...v2.3.4) (2022-03-03)
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
- add pnpm build to release command ([1c01f61](https://github.com/oekazuma/svelte-meta-tags/commit/1c01f619c5cd1dee51c58f4067fd315907fb4753))
|
|
12
|
+
|
|
13
|
+
## [2.3.3](https://github.com/oekazuma/svelte-meta-tags/compare/v2.3.2...v2.3.3) (2022-03-03)
|
|
14
|
+
|
|
15
|
+
### Bug Fixes
|
|
16
|
+
|
|
17
|
+
- fix tsconfig.json ([bd54216](https://github.com/oekazuma/svelte-meta-tags/commit/bd542167bc0f377157d7337b9eb2e9b58d63a625))
|
|
18
|
+
|
|
1
19
|
## [2.3.2](https://github.com/oekazuma/svelte-meta-tags/compare/v2.3.1...v2.3.2) (2022-02-28)
|
|
2
20
|
|
|
3
21
|
### Bug Fixes
|
package/JsonLd.svelte
CHANGED
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
<script>
|
|
2
|
+
export let output = 'head';
|
|
2
3
|
export let schema = undefined;
|
|
3
4
|
</script>
|
|
4
5
|
|
|
5
6
|
<svelte:head>
|
|
6
|
-
{#if schema}
|
|
7
|
+
{#if schema && output === 'head'}
|
|
7
8
|
{@html `<script type="application/ld+json">${
|
|
8
9
|
JSON.stringify({ '@context': 'https://schema.org', ...schema }) + '<'
|
|
9
10
|
}/script>`}
|
|
10
11
|
{/if}
|
|
11
12
|
</svelte:head>
|
|
13
|
+
|
|
14
|
+
{#if schema && output === 'body'}
|
|
15
|
+
{@html `<script type="application/ld+json">${
|
|
16
|
+
JSON.stringify({ '@context': 'https://schema.org', ...schema }) + '<'
|
|
17
|
+
}/script>`}
|
|
18
|
+
{/if}
|
package/MetaTags.svelte
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script>
|
|
2
2
|
export let title = '';
|
|
3
|
+
export let titleTemplate = '';
|
|
3
4
|
export let noindex = false;
|
|
4
5
|
export let nofollow = false;
|
|
5
6
|
export let robotsProps = undefined;
|
|
@@ -13,6 +14,10 @@
|
|
|
13
14
|
export let additionalMetaTags = undefined;
|
|
14
15
|
export let additionalLinkTags = undefined;
|
|
15
16
|
|
|
17
|
+
if (titleTemplate) {
|
|
18
|
+
title = titleTemplate.replace(/%s/g, title);
|
|
19
|
+
}
|
|
20
|
+
|
|
16
21
|
let robotsParams = '';
|
|
17
22
|
if (robotsProps) {
|
|
18
23
|
const {
|
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ This library is inspired by [next-seo](https://github.com/garmeeh/next-seo)
|
|
|
19
19
|
|
|
20
20
|
- [Installing](#-installing)
|
|
21
21
|
- [Usage](#-usage)
|
|
22
|
-
- [Properties](#properties)
|
|
22
|
+
- [MetaTags Properties](#metatags-properties)
|
|
23
23
|
- [Twitter](#twitter)
|
|
24
24
|
- [Facebook](#facebook)
|
|
25
25
|
- [robotsProps](#robotsprops)
|
|
@@ -35,6 +35,7 @@ This library is inspired by [next-seo](https://github.com/garmeeh/next-seo)
|
|
|
35
35
|
- [Profile](#profile)
|
|
36
36
|
- [JSON-LD](#json-ld)
|
|
37
37
|
- [Using schema-dts](#using-schema-dts)
|
|
38
|
+
- [JSON-LD Properties](#json-ld-properties)
|
|
38
39
|
- [JSON-LD Examples](#json-ld-examples)
|
|
39
40
|
- [Article](#article)
|
|
40
41
|
- [Breadcrumb](#breadcrumb)
|
|
@@ -123,11 +124,12 @@ pnpm add -D svelte-meta-tags
|
|
|
123
124
|
/>
|
|
124
125
|
```
|
|
125
126
|
|
|
126
|
-
### Properties
|
|
127
|
+
### MetaTags Properties
|
|
127
128
|
|
|
128
129
|
| Property | Type | Description |
|
|
129
130
|
| ---------------------------------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
130
131
|
| `title` | string | Sets the page meta title. |
|
|
132
|
+
| `titleTemplate` | string | Allows you to set default title template that will be added to your title [More Info](#title-template) |
|
|
131
133
|
| `noindex` | boolean (default false) | Sets whether page should be indexed or not |
|
|
132
134
|
| `nofollow` | boolean (default false) | Sets whether page should be followed or not |
|
|
133
135
|
| `additionRobotsProps` | Object | Set the more meta information for the `X-Robots-Tag` [More Info](#robotsprops) |
|
|
@@ -169,6 +171,22 @@ pnpm add -D svelte-meta-tags
|
|
|
169
171
|
| `openGraph.article.section` | string | A high-level section name. E.g. Technology |
|
|
170
172
|
| `openGraph.article.tags` | string[] | Tag words associated with this article. |
|
|
171
173
|
|
|
174
|
+
#### Title Template
|
|
175
|
+
|
|
176
|
+
Replaces `%s` with your title string
|
|
177
|
+
|
|
178
|
+
```js
|
|
179
|
+
title = 'This is my title';
|
|
180
|
+
titleTemplate = 'Svelte Meta Tags | %s';
|
|
181
|
+
// outputs: Svelte Meta Tags | This is my title
|
|
182
|
+
```
|
|
183
|
+
|
|
184
|
+
```js
|
|
185
|
+
title = 'This is my title';
|
|
186
|
+
titleTemplate = '%s | Svelte Meta Tags';
|
|
187
|
+
// outputs: This is my title | Svelte Meta Tags
|
|
188
|
+
```
|
|
189
|
+
|
|
172
190
|
#### Twitter
|
|
173
191
|
|
|
174
192
|
```js
|
|
@@ -564,6 +582,13 @@ It is also possible to use multiple `<JsonLd />` components in a single page.
|
|
|
564
582
|
|
|
565
583
|
This plugin uses [schema-dts](https://github.com/google/schema-dts), so it also provides types other than the usage examples below.
|
|
566
584
|
|
|
585
|
+
### JSON-LD Properties
|
|
586
|
+
|
|
587
|
+
| Property | Type | Description |
|
|
588
|
+
| -------- | --------------------- | ---------------------------------------------------------------------------------------------------- |
|
|
589
|
+
| `output` | string (default head) | Sets whether json-ld is output to `<head>` or `<body>`. Possible values are either `head` or `body`. |
|
|
590
|
+
| `schema` | Object | Data in `ld+json` format. [See Examples](#json-ld-examples) |
|
|
591
|
+
|
|
567
592
|
### JSON-LD Examples
|
|
568
593
|
|
|
569
594
|
#### Article
|
package/index.js
CHANGED
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.JsonLd = exports.MetaTags = void 0;
|
|
4
|
-
var MetaTags_svelte_1 = require("./MetaTags.svelte");
|
|
5
|
-
Object.defineProperty(exports, "MetaTags", { enumerable: true, get: function () { return MetaTags_svelte_1.default; } });
|
|
6
|
-
var JsonLd_svelte_1 = require("./JsonLd.svelte");
|
|
7
|
-
Object.defineProperty(exports, "JsonLd", { enumerable: true, get: function () { return JsonLd_svelte_1.default; } });
|
|
1
|
+
export { default as MetaTags } from './MetaTags.svelte';
|
|
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": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
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",
|
|
@@ -21,36 +21,36 @@
|
|
|
21
21
|
"schema-dts": "1.1.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@commitlint/cli": "16.2.
|
|
24
|
+
"@commitlint/cli": "16.2.3",
|
|
25
25
|
"@commitlint/config-conventional": "16.2.1",
|
|
26
26
|
"@semantic-release/changelog": "6.0.1",
|
|
27
27
|
"@semantic-release/git": "10.0.1",
|
|
28
|
-
"@sveltejs/adapter-auto": "1.0.0-next.
|
|
29
|
-
"@sveltejs/kit": "1.0.0-next.
|
|
30
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
31
|
-
"@typescript-eslint/parser": "5.
|
|
32
|
-
"cypress": "9.5.
|
|
33
|
-
"eslint": "8.
|
|
28
|
+
"@sveltejs/adapter-auto": "1.0.0-next.33",
|
|
29
|
+
"@sveltejs/kit": "1.0.0-next.301",
|
|
30
|
+
"@typescript-eslint/eslint-plugin": "5.15.0",
|
|
31
|
+
"@typescript-eslint/parser": "5.15.0",
|
|
32
|
+
"cypress": "9.5.2",
|
|
33
|
+
"eslint": "8.11.0",
|
|
34
34
|
"eslint-config-prettier": "8.5.0",
|
|
35
35
|
"eslint-plugin-cypress": "2.12.1",
|
|
36
36
|
"eslint-plugin-svelte3": "3.4.1",
|
|
37
37
|
"husky": "7.0.4",
|
|
38
|
-
"lint-staged": "12.3.
|
|
39
|
-
"prettier": "2.
|
|
38
|
+
"lint-staged": "12.3.7",
|
|
39
|
+
"prettier": "2.6.0",
|
|
40
40
|
"prettier-plugin-svelte": "2.6.0",
|
|
41
41
|
"semantic-release": "19.0.2",
|
|
42
42
|
"svelte": "3.46.4",
|
|
43
|
-
"svelte-check": "2.4.
|
|
43
|
+
"svelte-check": "2.4.6",
|
|
44
44
|
"svelte-preprocess": "4.10.4",
|
|
45
|
-
"svelte2tsx": "0.5.
|
|
45
|
+
"svelte2tsx": "0.5.6",
|
|
46
46
|
"tslib": "2.3.1",
|
|
47
|
-
"typescript": "
|
|
47
|
+
"typescript": "4.6.2"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"svelte": "^3.39.0"
|
|
51
51
|
},
|
|
52
52
|
"lint-staged": {
|
|
53
|
-
"*.{js,ts,svelte,md,html,css,json}": "pnpm format",
|
|
53
|
+
"*.{js,ts,cjs,svelte,md,html,css,json,yml,yaml}": "pnpm format",
|
|
54
54
|
"*.{js,ts,svelte}": [
|
|
55
55
|
"pnpm lint",
|
|
56
56
|
"pnpm check"
|
package/types.d.ts
CHANGED
|
@@ -138,6 +138,7 @@ export interface LinkTag {
|
|
|
138
138
|
|
|
139
139
|
export interface MetaTagsProps {
|
|
140
140
|
title?: string;
|
|
141
|
+
titleTemplate?: string;
|
|
141
142
|
noindex?: boolean;
|
|
142
143
|
nofollow?: boolean;
|
|
143
144
|
robotsProps?: AdditionalRobotsProps;
|
|
@@ -153,5 +154,6 @@ export interface MetaTagsProps {
|
|
|
153
154
|
}
|
|
154
155
|
|
|
155
156
|
export interface JsonLdProps {
|
|
157
|
+
output?: 'head' | 'body';
|
|
156
158
|
schema?: Thing | WithContext<Thing>;
|
|
157
159
|
}
|