react-datocms 1.6.9 → 2.1.2
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/README.md +158 -60
- package/dist/cjs/Image/__tests__/index.test.js +32 -28
- package/dist/cjs/Image/__tests__/index.test.js.map +1 -1
- package/dist/cjs/Image/index.js +27 -15
- package/dist/cjs/Image/index.js.map +1 -1
- package/dist/cjs/Seo/__tests__/index.test.js +272 -37
- package/dist/cjs/Seo/__tests__/index.test.js.map +1 -1
- package/dist/cjs/Seo/index.js +13 -60
- package/dist/cjs/Seo/index.js.map +1 -1
- package/dist/cjs/Seo/remixUtils.js +33 -0
- package/dist/cjs/Seo/remixUtils.js.map +1 -0
- package/dist/cjs/Seo/renderMetaTags.js +40 -0
- package/dist/cjs/Seo/renderMetaTags.js.map +1 -0
- package/dist/cjs/Seo/renderMetaTagsToString.js +22 -0
- package/dist/cjs/Seo/renderMetaTagsToString.js.map +1 -0
- package/dist/cjs/Seo/types.js +5 -0
- package/dist/cjs/Seo/types.js.map +1 -0
- package/dist/cjs/useQuerySubscription/index.js +1 -1
- package/dist/cjs/useQuerySubscription/index.js.map +1 -1
- package/dist/esm/Image/__tests__/index.test.js +36 -32
- package/dist/esm/Image/__tests__/index.test.js.map +1 -1
- package/dist/esm/Image/index.d.ts +17 -4
- package/dist/esm/Image/index.js +30 -18
- package/dist/esm/Image/index.js.map +1 -1
- package/dist/esm/Seo/__tests__/index.test.js +271 -36
- package/dist/esm/Seo/__tests__/index.test.js.map +1 -1
- package/dist/esm/Seo/index.d.ts +4 -12
- package/dist/esm/Seo/index.js +4 -55
- package/dist/esm/Seo/index.js.map +1 -1
- package/dist/esm/Seo/remixUtils.d.ts +6 -0
- package/dist/esm/Seo/remixUtils.js +29 -0
- package/dist/esm/Seo/remixUtils.js.map +1 -0
- package/dist/esm/Seo/renderMetaTags.d.ts +3 -0
- package/dist/esm/Seo/renderMetaTags.js +33 -0
- package/dist/esm/Seo/renderMetaTags.js.map +1 -0
- package/dist/esm/Seo/renderMetaTagsToString.d.ts +2 -0
- package/dist/esm/Seo/renderMetaTagsToString.js +18 -0
- package/dist/esm/Seo/renderMetaTagsToString.js.map +1 -0
- package/dist/esm/Seo/types.d.ts +37 -0
- package/dist/esm/Seo/types.js +4 -0
- package/dist/esm/Seo/types.js.map +1 -0
- package/dist/esm/useQuerySubscription/index.js +1 -1
- package/dist/esm/useQuerySubscription/index.js.map +1 -1
- package/dist/types/Image/index.d.ts +17 -4
- package/dist/types/Seo/index.d.ts +4 -12
- package/dist/types/Seo/remixUtils.d.ts +6 -0
- package/dist/types/Seo/renderMetaTags.d.ts +3 -0
- package/dist/types/Seo/renderMetaTagsToString.d.ts +2 -0
- package/dist/types/Seo/types.d.ts +37 -0
- package/package.json +1 -1
package/dist/esm/Seo/index.js
CHANGED
|
@@ -1,56 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import React from "react";
|
|
13
|
-
export var renderMetaTags = function (data) {
|
|
14
|
-
return data.map(function (_a) {
|
|
15
|
-
var tag = _a.tag, attributes = _a.attributes, content = _a.content;
|
|
16
|
-
var key = [tag];
|
|
17
|
-
if (attributes && "property" in attributes) {
|
|
18
|
-
key.push(attributes.property);
|
|
19
|
-
}
|
|
20
|
-
if (attributes && "name" in attributes) {
|
|
21
|
-
key.push(attributes.name);
|
|
22
|
-
}
|
|
23
|
-
if (attributes && "rel" in attributes) {
|
|
24
|
-
key.push(attributes.rel);
|
|
25
|
-
}
|
|
26
|
-
if (attributes && "sizes" in attributes) {
|
|
27
|
-
key.push(attributes.sizes);
|
|
28
|
-
}
|
|
29
|
-
var Tag = tag;
|
|
30
|
-
return (React.createElement(Tag, __assign({ key: key.join("-") }, attributes), content));
|
|
31
|
-
});
|
|
32
|
-
};
|
|
33
|
-
var serializeAttributes = function (attributes) {
|
|
34
|
-
if (!attributes) {
|
|
35
|
-
return "";
|
|
36
|
-
}
|
|
37
|
-
var serializedAttrs = [];
|
|
38
|
-
for (var key in attributes) {
|
|
39
|
-
if (Object.prototype.hasOwnProperty.call(attributes, key)) {
|
|
40
|
-
serializedAttrs.push(key + "=\"" + attributes[key] + "\"");
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return " " + serializedAttrs.join(" ");
|
|
44
|
-
};
|
|
45
|
-
export var renderMetaTagsToString = function (data) {
|
|
46
|
-
return data
|
|
47
|
-
.map(function (_a) {
|
|
48
|
-
var tag = _a.tag, attributes = _a.attributes, content = _a.content;
|
|
49
|
-
if (content) {
|
|
50
|
-
return "<" + tag + serializeAttributes(attributes) + ">" + content + "</" + tag + ">";
|
|
51
|
-
}
|
|
52
|
-
return "<" + tag + serializeAttributes(attributes) + " />";
|
|
53
|
-
})
|
|
54
|
-
.join("\n");
|
|
55
|
-
};
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './remixUtils';
|
|
3
|
+
export * from './renderMetaTags';
|
|
4
|
+
export * from './renderMetaTagsToString';
|
|
56
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Seo/index.
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/Seo/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
export function toRemixMeta(metaTags) {
|
|
13
|
+
if (!metaTags) {
|
|
14
|
+
return {};
|
|
15
|
+
}
|
|
16
|
+
return metaTags.reduce(function (acc, tag) {
|
|
17
|
+
var _a;
|
|
18
|
+
if (tag.tag === 'title') {
|
|
19
|
+
return tag.content ? __assign(__assign({}, acc), { title: tag.content }) : acc;
|
|
20
|
+
}
|
|
21
|
+
if (tag.tag === 'link') {
|
|
22
|
+
return acc;
|
|
23
|
+
}
|
|
24
|
+
return __assign(__assign({}, acc), (_a = {}, _a['property' in tag.attributes
|
|
25
|
+
? tag.attributes.property
|
|
26
|
+
: tag.attributes.name] = tag.attributes.content, _a));
|
|
27
|
+
}, {});
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=remixUtils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"remixUtils.js","sourceRoot":"","sources":["../../../src/Seo/remixUtils.ts"],"names":[],"mappings":";;;;;;;;;;;AAiCA,MAAM,UAAU,WAAW,CACzB,QAAkC;IAElC,IAAI,CAAC,QAAQ,EAAE;QACb,OAAO,EAAE,CAAC;KACX;IAED,OAAO,QAAQ,CAAC,MAAM,CAAC,UAAC,GAAG,EAAE,GAAG;;QAC9B,IAAI,GAAG,CAAC,GAAG,KAAK,OAAO,EAAE;YACvB,OAAO,GAAG,CAAC,OAAO,CAAC,CAAC,uBAAM,GAAG,KAAE,KAAK,EAAE,GAAG,CAAC,OAAO,IAAG,CAAC,CAAC,GAAG,CAAC;SAC3D;QAED,IAAI,GAAG,CAAC,GAAG,KAAK,MAAM,EAAE;YACtB,OAAO,GAAG,CAAC;SACZ;QAED,6BACK,GAAG,gBACL,UAAU,IAAI,GAAG,CAAC,UAAU;YAC3B,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,QAAQ;YACzB,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,IAAG,GAAG,CAAC,UAAU,CAAC,OAAO,OAChD;IACJ,CAAC,EAAE,EAA6B,CAAC,CAAC;AACpC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import React from 'react';
|
|
13
|
+
export function renderMetaTags(data) {
|
|
14
|
+
return data.map(function (_a) {
|
|
15
|
+
var tag = _a.tag, attributes = _a.attributes, content = _a.content;
|
|
16
|
+
var key = [tag];
|
|
17
|
+
if (attributes && 'property' in attributes) {
|
|
18
|
+
key.push(attributes.property);
|
|
19
|
+
}
|
|
20
|
+
if (attributes && 'name' in attributes) {
|
|
21
|
+
key.push(attributes.name);
|
|
22
|
+
}
|
|
23
|
+
if (attributes && 'rel' in attributes) {
|
|
24
|
+
key.push(attributes.rel);
|
|
25
|
+
}
|
|
26
|
+
if (attributes && 'sizes' in attributes) {
|
|
27
|
+
key.push(attributes.sizes);
|
|
28
|
+
}
|
|
29
|
+
var Tag = tag;
|
|
30
|
+
return (React.createElement(Tag, __assign({ key: key.join('-') }, attributes), content));
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=renderMetaTags.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderMetaTags.js","sourceRoot":"","sources":["../../../src/Seo/renderMetaTags.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,UAAU,cAAc,CAAC,IAAuB;IACpD,OAAO,IAAI,CAAC,GAAG,CAAC,UAAC,EAA4B;YAA1B,GAAG,SAAA,EAAE,UAAU,gBAAA,EAAE,OAAO,aAAA;QACzC,IAAI,GAAG,GAAa,CAAC,GAAG,CAAC,CAAC;QAE1B,IAAI,UAAU,IAAI,UAAU,IAAI,UAAU,EAAE;YAC1C,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;SAC/B;QAED,IAAI,UAAU,IAAI,MAAM,IAAI,UAAU,EAAE;YACtC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC;SAC3B;QAED,IAAI,UAAU,IAAI,KAAK,IAAI,UAAU,EAAE;YACrC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;SAC1B;QAED,IAAI,UAAU,IAAI,OAAO,IAAI,UAAU,EAAE;YACvC,GAAG,CAAC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;SAC5B;QAED,IAAM,GAAG,GAAG,GAAG,CAAC;QAEhB,OAAO,CACL,oBAAC,GAAG,aAAC,GAAG,EAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,IAAM,UAAU,GACpC,OAAO,CACJ,CACP,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export function renderMetaTagsToString(data) {
|
|
2
|
+
return data
|
|
3
|
+
.map(function (tag) {
|
|
4
|
+
if (tag.tag === 'title') {
|
|
5
|
+
return "<title>" + tag.content + "</title>";
|
|
6
|
+
}
|
|
7
|
+
var serializedAttrs = [];
|
|
8
|
+
for (var key in tag.attributes) {
|
|
9
|
+
if (Object.prototype.hasOwnProperty.call(tag.attributes, key)) {
|
|
10
|
+
serializedAttrs.push(key + "=\"" + tag.attributes[key] + "\"");
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
return "<" + tag.tag + " " + serializedAttrs.join(' ') + " />";
|
|
14
|
+
})
|
|
15
|
+
.join('\n');
|
|
16
|
+
}
|
|
17
|
+
;
|
|
18
|
+
//# sourceMappingURL=renderMetaTagsToString.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderMetaTagsToString.js","sourceRoot":"","sources":["../../../src/Seo/renderMetaTagsToString.tsx"],"names":[],"mappings":"AAEA,MAAM,UAAU,sBAAsB,CAAC,IAAuB;IAC5D,OAAO,IAAI;SACR,GAAG,CAAC,UAAC,GAAG;QACP,IAAI,GAAG,CAAC,GAAG,KAAK,OAAO,EAAE;YACvB,OAAO,YAAU,GAAG,CAAC,OAAO,aAAU,CAAC;SACxC;QAED,IAAM,eAAe,GAAG,EAAE,CAAC;QAE3B,KAAK,IAAM,GAAG,IAAI,GAAG,CAAC,UAAU,EAAE;YAChC,IAAI,MAAM,CAAC,SAAS,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,EAAE;gBAC7D,eAAe,CAAC,IAAI,CAAI,GAAG,WAAM,GAAG,CAAC,UAAkB,CAAC,GAAG,CAAC,OAAG,CAAC,CAAC;aAClE;SACF;QAED,OAAO,MAAI,GAAG,CAAC,GAAG,SAAI,eAAe,CAAC,IAAI,CAAC,GAAG,CAAC,QAAK,CAAC;IACvD,CAAC,CAAC;SACD,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC;AAAA,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface SeoTitleTag {
|
|
2
|
+
tag: 'title';
|
|
3
|
+
content: string | null;
|
|
4
|
+
attributes?: null;
|
|
5
|
+
}
|
|
6
|
+
export interface RegularMetaAttributes {
|
|
7
|
+
name: string;
|
|
8
|
+
content: string;
|
|
9
|
+
}
|
|
10
|
+
export interface OgMetaAttributes {
|
|
11
|
+
property: string;
|
|
12
|
+
content: string;
|
|
13
|
+
}
|
|
14
|
+
export interface SeoMetaTag {
|
|
15
|
+
tag: 'meta';
|
|
16
|
+
content?: null;
|
|
17
|
+
attributes: RegularMetaAttributes | OgMetaAttributes;
|
|
18
|
+
}
|
|
19
|
+
export interface FaviconAttributes {
|
|
20
|
+
sizes: string;
|
|
21
|
+
type: string;
|
|
22
|
+
rel: string;
|
|
23
|
+
href: string;
|
|
24
|
+
}
|
|
25
|
+
export interface AppleTouchIconAttributes {
|
|
26
|
+
sizes: string;
|
|
27
|
+
rel: 'apple-touch-icon';
|
|
28
|
+
href: string;
|
|
29
|
+
}
|
|
30
|
+
export interface SeoLinkTag {
|
|
31
|
+
tag: 'link';
|
|
32
|
+
content?: null;
|
|
33
|
+
attributes: FaviconAttributes | AppleTouchIconAttributes;
|
|
34
|
+
}
|
|
35
|
+
export declare type SeoTag = SeoTitleTag | SeoMetaTag;
|
|
36
|
+
export declare type FaviconTag = SeoMetaTag | SeoLinkTag;
|
|
37
|
+
export declare type SeoOrFaviconTag = SeoTag | FaviconTag;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/Seo/types.tsx"],"names":[],"mappings":"AASC,CAAC;AAKD,CAAC"}
|
|
@@ -99,7 +99,7 @@ export function useQuerySubscription(options) {
|
|
|
99
99
|
unsubscribe();
|
|
100
100
|
}
|
|
101
101
|
};
|
|
102
|
-
},
|
|
102
|
+
}, [subscribeToQueryOptions]);
|
|
103
103
|
return { error: error, status: status, data: data || initialData };
|
|
104
104
|
}
|
|
105
105
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/useQuerySubscription/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,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uBAC/B,uBAAuB,KAC1B,cAAc,EAAE,UAAC,MAAM;oCACrB,SAAS,CAAC,MAAM,CAAC,CAAC;gCACpB,CAAC,EACD,QAAQ,EAAE,UAAC,UAAU;oCACnB,QAAQ,CAAC,IAAI,CAAC,CAAC;oCACf,OAAO,CAAC,UAAU,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;gCACpC,CAAC,EACD,cAAc,EAAE,UAAC,SAAS;oCACxB,OAAO,CAAC,IAAI,CAAC,CAAC;oCACd,QAAQ,CAAC,SAAS,CAAC,CAAC;gCACtB,CAAC,IACD,EAAA;;4BAbF,WAAW,GAAG,SAaZ,CAAC;;;;;SACJ;QAED,SAAS,EAAE,CAAC;QAEZ,OAAO;YACL,IAAI,WAAW,EAAE;gBACf,WAAW,EAAE,CAAC;aACf;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,uBAAuB,CAAC,CAAC,CAAC;IAE9B,OAAO,EAAE,KAAK,OAAA,EAAE,MAAM,QAAA,EAAE,IAAI,EAAE,IAAI,IAAI,WAAW,EAAE,CAAC;AACtD,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import
|
|
1
|
+
import React, { CSSProperties } from 'react';
|
|
2
|
+
import 'intersection-observer';
|
|
3
3
|
export declare type ResponsiveImageType = {
|
|
4
4
|
/** The aspect ratio (width/height) of the image */
|
|
5
5
|
aspectRatio: number;
|
|
@@ -45,8 +45,21 @@ declare type ImagePropTypes = {
|
|
|
45
45
|
style?: React.CSSProperties;
|
|
46
46
|
/** Additional CSS rules to add to the image inside the `<picture />` tag */
|
|
47
47
|
pictureStyle?: React.CSSProperties;
|
|
48
|
-
/**
|
|
49
|
-
|
|
48
|
+
/**
|
|
49
|
+
* The layout behavior of the image as the viewport changes size
|
|
50
|
+
*
|
|
51
|
+
* Possible values:
|
|
52
|
+
*
|
|
53
|
+
* * `intrinsic` (default): the image will scale the dimensions down for smaller viewports, but maintain the original dimensions for larger viewports
|
|
54
|
+
* * `fixed`: the image dimensions will not change as the viewport changes (no responsiveness) similar to the native img element
|
|
55
|
+
* * `responsive`: the image will scale the dimensions down for smaller viewports and scale up for larger viewports
|
|
56
|
+
* * `fill`: image will stretch both width and height to the dimensions of the parent element, provided the parent element is `relative`
|
|
57
|
+
* */
|
|
58
|
+
layout?: 'intrinsic' | 'fixed' | 'responsive' | 'fill';
|
|
59
|
+
/** Defines how the image will fit into its parent container when using layout="fill" */
|
|
60
|
+
objectFit?: CSSProperties['objectFit'];
|
|
61
|
+
/** Defines how the image is positioned within its parent element when using layout="fill". */
|
|
62
|
+
objectPosition?: CSSProperties['objectPosition'];
|
|
50
63
|
/** Triggered when the image finishes loading */
|
|
51
64
|
onLoad?(): void;
|
|
52
65
|
/** Whether the component should use a blurred image placeholder */
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
/** the inner content of the meta tag */
|
|
6
|
-
content: string | null;
|
|
7
|
-
/** the HTML attributes to attach to the meta tag */
|
|
8
|
-
attributes: Record<string, string> | null;
|
|
9
|
-
};
|
|
10
|
-
export declare type ToMetaTagsType = SeoMetaTagType[];
|
|
11
|
-
export declare const renderMetaTags: (data: SeoMetaTagType[]) => JSX.Element[];
|
|
12
|
-
export declare const renderMetaTagsToString: (data: SeoMetaTagType[]) => string;
|
|
1
|
+
export * from './types';
|
|
2
|
+
export * from './remixUtils';
|
|
3
|
+
export * from './renderMetaTags';
|
|
4
|
+
export * from './renderMetaTagsToString';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export interface SeoTitleTag {
|
|
2
|
+
tag: 'title';
|
|
3
|
+
content: string | null;
|
|
4
|
+
attributes?: null;
|
|
5
|
+
}
|
|
6
|
+
export interface RegularMetaAttributes {
|
|
7
|
+
name: string;
|
|
8
|
+
content: string;
|
|
9
|
+
}
|
|
10
|
+
export interface OgMetaAttributes {
|
|
11
|
+
property: string;
|
|
12
|
+
content: string;
|
|
13
|
+
}
|
|
14
|
+
export interface SeoMetaTag {
|
|
15
|
+
tag: 'meta';
|
|
16
|
+
content?: null;
|
|
17
|
+
attributes: RegularMetaAttributes | OgMetaAttributes;
|
|
18
|
+
}
|
|
19
|
+
export interface FaviconAttributes {
|
|
20
|
+
sizes: string;
|
|
21
|
+
type: string;
|
|
22
|
+
rel: string;
|
|
23
|
+
href: string;
|
|
24
|
+
}
|
|
25
|
+
export interface AppleTouchIconAttributes {
|
|
26
|
+
sizes: string;
|
|
27
|
+
rel: 'apple-touch-icon';
|
|
28
|
+
href: string;
|
|
29
|
+
}
|
|
30
|
+
export interface SeoLinkTag {
|
|
31
|
+
tag: 'link';
|
|
32
|
+
content?: null;
|
|
33
|
+
attributes: FaviconAttributes | AppleTouchIconAttributes;
|
|
34
|
+
}
|
|
35
|
+
export declare type SeoTag = SeoTitleTag | SeoMetaTag;
|
|
36
|
+
export declare type FaviconTag = SeoMetaTag | SeoLinkTag;
|
|
37
|
+
export declare type SeoOrFaviconTag = SeoTag | FaviconTag;
|