@koine/next 2.0.0-beta.2 → 2.0.0-beta.5
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/12/AnalyticsGoogle.js +65 -25
- package/12/AnalyticsGoogle.mjs +41 -15
- package/12/DisableErrorOverlay.js +29 -16
- package/12/DisableErrorOverlay.mjs +8 -5
- package/12/DynamicNamespaces.d.ts +1 -1
- package/12/DynamicNamespaces.js +22 -12
- package/12/DynamicNamespaces.mjs +1 -2
- package/12/Favicon.js +28 -9
- package/12/Favicon.mjs +6 -2
- package/12/Link.d.ts +1 -1
- package/12/Link.js +36 -13
- package/12/Link.mjs +14 -6
- package/12/NextProgress.js +47 -24
- package/12/NextProgress.mjs +26 -17
- package/12/Seo.d.ts +1 -1
- package/12/Seo.js +27 -32
- package/12/Seo.mjs +5 -4
- package/12/SeoDefaults.d.ts +1 -1
- package/12/SeoDefaults.js +27 -13
- package/12/SeoDefaults.mjs +5 -3
- package/12/T.d.ts +1 -1
- package/12/T.js +42 -16
- package/12/T.mjs +20 -6
- package/12/ThemeContext.js +22 -7
- package/12/ThemeContext.mjs +3 -3
- package/12/ThemeProvider.js +164 -147
- package/12/ThemeProvider.mjs +139 -129
- package/12/TransText.js +22 -7
- package/12/TransText.mjs +1 -1
- package/12/app/AppHead.js +29 -9
- package/12/app/AppHead.mjs +8 -2
- package/12/app/AppMain.d.ts +4 -4
- package/12/app/AppMain.js +5 -1
- package/12/app/AppMain.mjs +1 -1
- package/12/app/css/AppMain.js +37 -16
- package/12/app/css/AppMain.mjs +15 -5
- package/12/app/css/AppTheme.d.ts +1 -1
- package/12/app/css/AppTheme.js +28 -13
- package/12/app/css/AppTheme.mjs +7 -4
- package/12/app/css/auth/index.d.ts +1 -1
- package/12/app/css/auth/index.js +38 -15
- package/12/app/css/auth/index.mjs +17 -6
- package/12/app/css/index.d.ts +1 -1
- package/12/app/css/index.js +34 -59
- package/12/app/css/index.mjs +14 -6
- package/12/app/index.js +6 -4
- package/12/app/sc/AppMain.js +68 -27
- package/12/app/sc/AppMain.mjs +46 -13
- package/12/app/sc/AppTheme.d.ts +1 -1
- package/12/app/sc/AppTheme.js +31 -13
- package/12/app/sc/AppTheme.mjs +9 -4
- package/12/app/sc/auth/index.d.ts +1 -1
- package/12/app/sc/auth/index.js +38 -15
- package/12/app/sc/auth/index.mjs +17 -6
- package/12/app/sc/index.d.ts +1 -1
- package/12/app/sc/index.js +34 -61
- package/12/app/sc/index.mjs +14 -6
- package/12/document/Document.js +47 -29
- package/12/document/Document.mjs +24 -14
- package/12/document/css/index.js +47 -32
- package/12/document/css/index.mjs +26 -18
- package/12/document/index.js +18 -6
- package/12/document/sc/index.js +71 -65
- package/12/document/sc/index.mjs +46 -45
- package/12/getT.js +22 -13
- package/12/getT.mjs +2 -4
- package/12/index.js +99 -51
- package/12/index.mjs +2 -2
- package/12/seoBuildTags.js +81 -76
- package/12/seoBuildTags.mjs +59 -55
- package/12/to.js +21 -19
- package/12/to.mjs +4 -10
- package/12/translationAsOptions.js +15 -9
- package/12/translationAsOptions.mjs +6 -6
- package/12/types-i18n.js +4 -3
- package/12/types-i18n.mjs +1 -2
- package/12/types-seo.js +3 -1
- package/12/types-seo.mjs +1 -1
- package/12/useBackUrl.js +30 -16
- package/12/useBackUrl.mjs +8 -8
- package/12/useDateFormat.js +37 -38
- package/12/useDateFormat.mjs +15 -28
- package/12/useForm.d.ts +1 -1
- package/12/useForm.js +46 -20
- package/12/useForm.mjs +25 -13
- package/12/useLocale.js +22 -8
- package/12/useT.d.ts +1 -1
- package/12/useT.js +53 -39
- package/12/useT.mjs +32 -14
- package/12/useTheme.js +22 -11
- package/12/useTheme.mjs +1 -2
- package/12/useTo.js +23 -16
- package/12/useTo.mjs +3 -10
- package/README.md +1 -1
- package/config/index.js +225 -251
- package/config/index.mjs +187 -204
- package/getSiteUrl.js +22 -15
- package/getSiteUrl.mjs +2 -4
- package/index.js +19 -6
- package/load.js +21 -8
- package/load.mjs +3 -4
- package/package.json +19 -17
- package/12/app/css/auth/package.json +0 -6
- package/12/app/css/package.json +0 -6
- package/12/app/package.json +0 -6
- package/12/app/sc/auth/package.json +0 -6
- package/12/app/sc/package.json +0 -6
- package/12/document/css/package.json +0 -6
- package/12/document/package.json +0 -6
- package/12/document/sc/package.json +0 -6
- package/12/package.json +0 -6
- package/config/package.json +0 -6
package/12/document/sc/index.mjs
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
/* ? eslint-disable @next/next/no-document-import-in-page */ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import NextDocument, { Head, Html, Main, NextScript } from "next/document";
|
|
3
3
|
import React from "react";
|
|
4
|
-
/* ? eslint-disable @next/next/no-document-import-in-page */
|
|
5
|
-
import NextDocument, { Html, Head, Main, NextScript, } from "next/document";
|
|
6
4
|
import { ServerStyleSheet } from "styled-components";
|
|
7
5
|
import Meta from "@koine/react/Meta";
|
|
8
6
|
import NoJs from "@koine/react/NoJs";
|
|
@@ -18,47 +16,50 @@ import NoJs from "@koine/react/NoJs";
|
|
|
18
16
|
* ```tsx
|
|
19
17
|
* export { Document as default } from "@koine/next/document/sc";
|
|
20
18
|
* ```
|
|
21
|
-
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
19
|
+
*/ export class Document extends NextDocument {
|
|
20
|
+
static async getInitialProps(ctx) {
|
|
21
|
+
const sheet = new ServerStyleSheet();
|
|
22
|
+
const originalRenderPage = ctx.renderPage;
|
|
23
|
+
try {
|
|
24
|
+
ctx.renderPage = ()=>originalRenderPage({
|
|
25
|
+
enhanceApp: (App)=>(props)=>sheet.collectStyles(/*#__PURE__*/ _jsx(App, {
|
|
26
|
+
...props
|
|
27
|
+
}))
|
|
28
|
+
});
|
|
29
|
+
const initialProps = await NextDocument.getInitialProps(ctx);
|
|
30
|
+
return {
|
|
31
|
+
...initialProps,
|
|
32
|
+
styles: /*#__PURE__*/ _jsxs(React.Fragment, {
|
|
33
|
+
children: [
|
|
34
|
+
initialProps.styles,
|
|
35
|
+
sheet.getStyleElement()
|
|
36
|
+
]
|
|
37
|
+
})
|
|
38
|
+
};
|
|
39
|
+
} finally{
|
|
40
|
+
sheet.seal();
|
|
41
|
+
}
|
|
26
42
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
case 2:
|
|
47
|
-
initialProps = _a.sent();
|
|
48
|
-
return [2 /*return*/, __assign(__assign({}, initialProps), { styles: (_jsxs(React.Fragment, { children: [initialProps.styles, sheet.getStyleElement()] })) })];
|
|
49
|
-
case 3:
|
|
50
|
-
sheet.seal();
|
|
51
|
-
return [7 /*endfinally*/];
|
|
52
|
-
case 4: return [2 /*return*/];
|
|
53
|
-
}
|
|
54
|
-
});
|
|
43
|
+
render() {
|
|
44
|
+
const { locale, defaultLocale } = this.props.__NEXT_DATA__;
|
|
45
|
+
return /*#__PURE__*/ _jsxs(Html, {
|
|
46
|
+
lang: locale || defaultLocale,
|
|
47
|
+
className: "no-js",
|
|
48
|
+
children: [
|
|
49
|
+
/*#__PURE__*/ _jsxs(Head, {
|
|
50
|
+
children: [
|
|
51
|
+
/*#__PURE__*/ _jsx(Meta, {}),
|
|
52
|
+
/*#__PURE__*/ _jsx(NoJs, {})
|
|
53
|
+
]
|
|
54
|
+
}),
|
|
55
|
+
/*#__PURE__*/ _jsxs("body", {
|
|
56
|
+
children: [
|
|
57
|
+
/*#__PURE__*/ _jsx(Main, {}),
|
|
58
|
+
/*#__PURE__*/ _jsx(NextScript, {})
|
|
59
|
+
]
|
|
60
|
+
})
|
|
61
|
+
]
|
|
55
62
|
});
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
var _a = this.props.__NEXT_DATA__, locale = _a.locale, defaultLocale = _a.defaultLocale;
|
|
59
|
-
return (_jsxs(Html, { lang: locale || defaultLocale, className: "no-js", children: [_jsxs(Head, { children: [_jsx(Meta, {}), _jsx(NoJs, {})] }), _jsxs("body", { children: [_jsx(Main, {}), _jsx(NextScript, {})] })] }));
|
|
60
|
-
};
|
|
61
|
-
return Document;
|
|
62
|
-
}(NextDocument));
|
|
63
|
-
export { Document };
|
|
63
|
+
}
|
|
64
|
+
}
|
|
64
65
|
export default Document;
|
package/12/getT.js
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
"use strict";
|
|
2
1
|
"use client";
|
|
3
|
-
|
|
4
|
-
exports
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
exports
|
|
14
|
-
|
|
2
|
+
"use strict";
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
function _export(target, all) {
|
|
7
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: all[name]
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
_export(exports, {
|
|
13
|
+
getT: function() {
|
|
14
|
+
return getT;
|
|
15
|
+
},
|
|
16
|
+
default: function() {
|
|
17
|
+
return _default;
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
21
|
+
const _getT = /*#__PURE__*/ _interop_require_default._(require("next-translate/getT"));
|
|
22
|
+
const getT = _getT.default;
|
|
23
|
+
const _default = getT;
|
package/12/getT.mjs
CHANGED
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-unnecessary-type-constraint */
|
|
3
|
-
import getTranslation from "next-translate/getT";
|
|
2
|
+
/* eslint-disable @typescript-eslint/no-unnecessary-type-constraint */ import getTranslation from "next-translate/getT";
|
|
4
3
|
/**
|
|
5
4
|
* **NOTE**: To make typescript work nicely here make sure to enable
|
|
6
5
|
* [`resolveJsonModule`](https://www.typescriptlang.org/tsconfig#resolveJsonModule)
|
|
7
6
|
* in your `tsconfig.json` file.
|
|
8
|
-
*/
|
|
9
|
-
export var getT = getTranslation;
|
|
7
|
+
*/ export const getT = getTranslation;
|
|
10
8
|
export default getT;
|
package/12/index.js
CHANGED
|
@@ -1,52 +1,100 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
AnalyticsGoogle: function() {
|
|
13
|
+
return _AnalyticsGoogle.AnalyticsGoogle;
|
|
14
|
+
},
|
|
15
|
+
DisableErrorOverlay: function() {
|
|
16
|
+
return _DisableErrorOverlay.DisableErrorOverlay;
|
|
17
|
+
},
|
|
18
|
+
DynamicNamespaces: function() {
|
|
19
|
+
return _DynamicNamespaces.DynamicNamespaces;
|
|
20
|
+
},
|
|
21
|
+
Favicon: function() {
|
|
22
|
+
return _Favicon.Favicon;
|
|
23
|
+
},
|
|
24
|
+
getT: function() {
|
|
25
|
+
return _getT.getT;
|
|
26
|
+
},
|
|
27
|
+
Link: function() {
|
|
28
|
+
return _Link.Link;
|
|
29
|
+
},
|
|
30
|
+
NextProgress: function() {
|
|
31
|
+
return _NextProgress.NextProgress;
|
|
32
|
+
},
|
|
33
|
+
Seo: function() {
|
|
34
|
+
return _Seo.Seo;
|
|
35
|
+
},
|
|
36
|
+
SeoDefaults: function() {
|
|
37
|
+
return _SeoDefaults.SeoDefaults;
|
|
38
|
+
},
|
|
39
|
+
T: function() {
|
|
40
|
+
return _T.T;
|
|
41
|
+
},
|
|
42
|
+
ThemeContext: function() {
|
|
43
|
+
return _ThemeContext.ThemeContext;
|
|
44
|
+
},
|
|
45
|
+
ThemeProvider: function() {
|
|
46
|
+
return _ThemeProvider.ThemeProvider;
|
|
47
|
+
},
|
|
48
|
+
to: function() {
|
|
49
|
+
return _to.to;
|
|
50
|
+
},
|
|
51
|
+
translationAsOptions: function() {
|
|
52
|
+
return _translationAsOptions.translationAsOptions;
|
|
53
|
+
},
|
|
54
|
+
TransText: function() {
|
|
55
|
+
return _TransText.TransText;
|
|
56
|
+
},
|
|
57
|
+
useBackUrl: function() {
|
|
58
|
+
return _useBackUrl.useBackUrl;
|
|
59
|
+
},
|
|
60
|
+
useDateFormat: function() {
|
|
61
|
+
return _useDateFormat.useDateFormat;
|
|
62
|
+
},
|
|
63
|
+
useForm: function() {
|
|
64
|
+
return _useForm.useForm;
|
|
65
|
+
},
|
|
66
|
+
useLocale: function() {
|
|
67
|
+
return _useLocale.useLocale;
|
|
68
|
+
},
|
|
69
|
+
useT: function() {
|
|
70
|
+
return _useT.useT;
|
|
71
|
+
},
|
|
72
|
+
useTheme: function() {
|
|
73
|
+
return _useTheme.useTheme;
|
|
74
|
+
},
|
|
75
|
+
useTo: function() {
|
|
76
|
+
return _useTo.useTo;
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
const _AnalyticsGoogle = require("./AnalyticsGoogle");
|
|
80
|
+
const _DisableErrorOverlay = require("./DisableErrorOverlay");
|
|
81
|
+
const _DynamicNamespaces = require("./DynamicNamespaces");
|
|
82
|
+
const _Favicon = require("./Favicon");
|
|
83
|
+
const _getT = require("./getT");
|
|
84
|
+
const _Link = require("./Link");
|
|
85
|
+
const _NextProgress = require("./NextProgress");
|
|
86
|
+
const _Seo = require("./Seo");
|
|
87
|
+
const _SeoDefaults = require("./SeoDefaults");
|
|
88
|
+
const _T = require("./T");
|
|
89
|
+
const _ThemeContext = require("./ThemeContext");
|
|
90
|
+
const _ThemeProvider = require("./ThemeProvider");
|
|
91
|
+
const _to = require("./to");
|
|
92
|
+
const _translationAsOptions = require("./translationAsOptions");
|
|
93
|
+
const _TransText = require("./TransText");
|
|
94
|
+
const _useBackUrl = require("./useBackUrl");
|
|
95
|
+
const _useDateFormat = require("./useDateFormat");
|
|
96
|
+
const _useForm = require("./useForm");
|
|
97
|
+
const _useLocale = require("./useLocale");
|
|
98
|
+
const _useT = require("./useT");
|
|
99
|
+
const _useTheme = require("./useTheme");
|
|
100
|
+
const _useTo = require("./useTo");
|
package/12/index.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { AnalyticsGoogle } from "./AnalyticsGoogle";
|
|
2
2
|
export { DisableErrorOverlay } from "./DisableErrorOverlay";
|
|
3
|
-
export { DynamicNamespaces
|
|
3
|
+
export { DynamicNamespaces } from "./DynamicNamespaces";
|
|
4
4
|
export { Favicon } from "./Favicon";
|
|
5
5
|
export { getT } from "./getT";
|
|
6
6
|
export { Link } from "./Link";
|
|
@@ -15,7 +15,7 @@ export { SeoDefaults } from "./SeoDefaults";
|
|
|
15
15
|
export { T } from "./T";
|
|
16
16
|
export { ThemeContext } from "./ThemeContext";
|
|
17
17
|
export { ThemeProvider } from "./ThemeProvider";
|
|
18
|
-
export { to
|
|
18
|
+
export { to } from "./to";
|
|
19
19
|
export { translationAsOptions } from "./translationAsOptions";
|
|
20
20
|
export { TransText } from "./TransText";
|
|
21
21
|
export { useBackUrl } from "./useBackUrl";
|
package/12/seoBuildTags.js
CHANGED
|
@@ -1,109 +1,115 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
seoBuildTags: function() {
|
|
13
|
+
return seoBuildTags;
|
|
14
|
+
},
|
|
15
|
+
default: function() {
|
|
16
|
+
return _default;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const _interop_require_default = require("@swc/helpers/_/_interop_require_default");
|
|
20
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
21
|
+
const _react = /*#__PURE__*/ _interop_require_default._(require("react"));
|
|
22
|
+
const _isArray = /*#__PURE__*/ _interop_require_default._(require("@koine/utils/isArray"));
|
|
23
|
+
const defaults = {
|
|
24
|
+
tplTitle: ""
|
|
9
25
|
};
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
* - Add `ogimage` and `openGraph.image` as single image source
|
|
16
|
-
* - Add `og` alias to define `openGraph`
|
|
17
|
-
* - Add check for `title` equal to `templateTitle` to avoid meta titles like
|
|
18
|
-
* "My site | My site" often happening in homepages
|
|
19
|
-
* - Remove the open graph videos and images
|
|
20
|
-
*
|
|
21
|
-
* - Shorter code
|
|
22
|
-
*
|
|
23
|
-
* @returns
|
|
24
|
-
*/
|
|
25
|
-
var seoBuildTags = function (_a) {
|
|
26
|
-
var _b = _a === void 0 ? {} : _a, seo = _b.seo, hidden = _b.hidden, keywords = _b.keywords, _c = _b.title, title = _c === void 0 ? "" : _c, titleTemplate = _b.titleTemplate, defaultTitle = _b.defaultTitle, noindex = _b.noindex, nofollow = _b.nofollow, description = _b.description, _d = _b.languageAlternates, languageAlternates = _d === void 0 ? [] : _d, twitter = _b.twitter, facebook = _b.facebook, openGraph = _b.openGraph, ogAlias = _b.og, canonical = _b.canonical, metaTags = _b.metaTags, linkTags = _b.linkTags;
|
|
27
|
-
var id = "seo-";
|
|
28
|
-
var render = [];
|
|
29
|
-
var $names = {};
|
|
30
|
-
var $properties = {};
|
|
26
|
+
const seoBuildTags = ({ seo, hidden, keywords, title = "", titleTemplate, defaultTitle, noindex, nofollow, description, languageAlternates = [], twitter, facebook, openGraph, og: ogAlias, canonical, metaTags, linkTags } = {})=>{
|
|
27
|
+
const id = "seo-";
|
|
28
|
+
const render = [];
|
|
29
|
+
const $names = {};
|
|
30
|
+
const $properties = {};
|
|
31
31
|
if (titleTemplate) {
|
|
32
32
|
defaults.tplTitle = titleTemplate;
|
|
33
33
|
}
|
|
34
|
-
title = title ||
|
|
34
|
+
title = title || seo?.title || "";
|
|
35
35
|
if (title) {
|
|
36
36
|
if (defaults.tplTitle && defaults.tplTitle !== title) {
|
|
37
37
|
title = defaults.tplTitle.replace(/%s/g, title);
|
|
38
38
|
}
|
|
39
|
-
}
|
|
40
|
-
else if (defaultTitle) {
|
|
39
|
+
} else if (defaultTitle) {
|
|
41
40
|
title = defaultTitle;
|
|
42
41
|
}
|
|
43
42
|
if (title) {
|
|
44
|
-
render.push((0,
|
|
43
|
+
render.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("title", {
|
|
44
|
+
children: title
|
|
45
|
+
}, id + "title"));
|
|
45
46
|
$properties["og:title"] = title; // overridden later...
|
|
46
47
|
}
|
|
47
|
-
$names["robots"] =
|
|
48
|
-
description = description ||
|
|
48
|
+
$names["robots"] = `${noindex || hidden ? "noindex" : "index"},${nofollow || hidden ? "nofollow" : "follow"}`;
|
|
49
|
+
description = description || seo?.description;
|
|
49
50
|
if (description) {
|
|
50
51
|
$names["description"] = description;
|
|
51
52
|
$properties["og:description"] = description; // overridden later...
|
|
52
53
|
}
|
|
53
|
-
keywords = keywords ||
|
|
54
|
+
keywords = keywords || seo?.keywords;
|
|
54
55
|
if (keywords) {
|
|
55
|
-
$names["keywords"] = (0,
|
|
56
|
+
$names["keywords"] = (0, _isArray.default)(keywords) ? keywords.join(", ") : keywords;
|
|
56
57
|
}
|
|
57
|
-
if (
|
|
58
|
-
languageAlternates.forEach(
|
|
59
|
-
|
|
60
|
-
|
|
58
|
+
if (languageAlternates?.length > 0) {
|
|
59
|
+
languageAlternates.forEach(({ href, hrefLang })=>{
|
|
60
|
+
render.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
|
|
61
|
+
rel: "alternate",
|
|
62
|
+
hrefLang: hrefLang,
|
|
63
|
+
href: href
|
|
64
|
+
}, id + "languageAlternate-" + hrefLang));
|
|
61
65
|
});
|
|
62
66
|
}
|
|
63
67
|
if (canonical) {
|
|
64
|
-
render.push((0,
|
|
68
|
+
render.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
|
|
69
|
+
rel: "canonical",
|
|
70
|
+
href: canonical
|
|
71
|
+
}, id + "canonical"));
|
|
65
72
|
$properties["og:url"] = canonical;
|
|
66
73
|
}
|
|
67
|
-
if (facebook
|
|
68
|
-
$properties["fb:app_id"] = facebook.appId;
|
|
74
|
+
if (facebook?.appId) $properties["fb:app_id"] = facebook.appId;
|
|
69
75
|
if (twitter) {
|
|
70
|
-
if (twitter.cardType)
|
|
71
|
-
|
|
72
|
-
if (twitter.
|
|
73
|
-
$names["twitter:site"] = twitter.site;
|
|
74
|
-
if (twitter.handle)
|
|
75
|
-
$names["twitter:creator"] = twitter.handle;
|
|
76
|
+
if (twitter.cardType) $names["twitter:card"] = twitter.cardType;
|
|
77
|
+
if (twitter.site) $names["twitter:site"] = twitter.site;
|
|
78
|
+
if (twitter.handle) $names["twitter:creator"] = twitter.handle;
|
|
76
79
|
}
|
|
77
|
-
|
|
78
|
-
if (og
|
|
79
|
-
|
|
80
|
-
if (og
|
|
81
|
-
|
|
82
|
-
if (og
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
if (ogimage)
|
|
92
|
-
$properties["og:image"] = ogimage;
|
|
93
|
-
Object.keys($names).forEach(function (key) {
|
|
94
|
-
render.push((0, jsx_runtime_1.jsx)("meta", { name: key, content: $names[key] }, id + "name-" + key));
|
|
80
|
+
const og = ogAlias || openGraph;
|
|
81
|
+
if (og?.title) $properties["og:title"] = og?.title;
|
|
82
|
+
if (og?.description) $properties["og:description"] = og?.description;
|
|
83
|
+
if (og?.url) $properties["og:url"] = og.url;
|
|
84
|
+
if (og?.type) $properties["og:type"] = og.type.toLowerCase();
|
|
85
|
+
if (og?.locale) $properties["og:locale"] = og.locale;
|
|
86
|
+
if (og?.siteName) $properties["og:siteName"] = og.siteName;
|
|
87
|
+
const ogimage = og?.image || seo?.ogimage;
|
|
88
|
+
if (ogimage) $properties["og:image"] = ogimage;
|
|
89
|
+
Object.keys($names).forEach((key)=>{
|
|
90
|
+
render.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
|
|
91
|
+
name: key,
|
|
92
|
+
content: $names[key]
|
|
93
|
+
}, id + "name-" + key));
|
|
95
94
|
});
|
|
96
|
-
Object.keys($properties).forEach(
|
|
97
|
-
render.push((0,
|
|
95
|
+
Object.keys($properties).forEach((key)=>{
|
|
96
|
+
render.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
|
|
97
|
+
property: key,
|
|
98
|
+
content: $properties[key]
|
|
99
|
+
}, id + "prop-" + +key));
|
|
98
100
|
});
|
|
99
101
|
if (metaTags && metaTags.length > 0) {
|
|
100
|
-
metaTags.forEach(
|
|
101
|
-
render.push((0,
|
|
102
|
+
metaTags.forEach((tag)=>{
|
|
103
|
+
render.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("meta", {
|
|
104
|
+
...tag
|
|
105
|
+
}, id + "meta-" + (tag.name || tag.property || tag.httpEquiv)));
|
|
102
106
|
});
|
|
103
107
|
}
|
|
104
|
-
if (linkTags
|
|
105
|
-
linkTags.forEach(
|
|
106
|
-
render.push((0,
|
|
108
|
+
if (linkTags?.length) {
|
|
109
|
+
linkTags.forEach((tag)=>{
|
|
110
|
+
render.push(/*#__PURE__*/ (0, _jsxruntime.jsx)("link", {
|
|
111
|
+
...tag
|
|
112
|
+
}, id + "link-" + (tag.href || tag.rel)));
|
|
107
113
|
});
|
|
108
114
|
}
|
|
109
115
|
// TODO: alternates and canonical
|
|
@@ -117,5 +123,4 @@ var seoBuildTags = function (_a) {
|
|
|
117
123
|
// <link rel="alternate" hreflang="en" href="https://www.domain.com/en/">
|
|
118
124
|
return render;
|
|
119
125
|
};
|
|
120
|
-
|
|
121
|
-
exports.default = exports.seoBuildTags;
|
|
126
|
+
const _default = seoBuildTags;
|