wgt-node-utils 1.2.61 → 1.2.63
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/dist/bundle.js +1 -1
- package/eslint.config.mjs +12 -12
- package/package.json +1 -1
- package/src/index.js +2 -1
package/eslint.config.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import globals from "globals";
|
|
2
|
-
import pluginJs from "@eslint/js";
|
|
3
|
-
import tseslint from "typescript-eslint";
|
|
4
|
-
import pluginReact from "eslint-plugin-react";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export default [
|
|
8
|
-
{files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"]},
|
|
9
|
-
{languageOptions: { globals: globals.browser }},
|
|
10
|
-
pluginJs.configs.recommended,
|
|
11
|
-
...tseslint.configs.recommended,
|
|
12
|
-
pluginReact.configs.flat.recommended,
|
|
1
|
+
import globals from "globals";
|
|
2
|
+
import pluginJs from "@eslint/js";
|
|
3
|
+
import tseslint from "typescript-eslint";
|
|
4
|
+
import pluginReact from "eslint-plugin-react";
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
export default [
|
|
8
|
+
{files: ["**/*.{js,mjs,cjs,ts,jsx,tsx}"]},
|
|
9
|
+
{languageOptions: { globals: globals.browser }},
|
|
10
|
+
pluginJs.configs.recommended,
|
|
11
|
+
...tseslint.configs.recommended,
|
|
12
|
+
pluginReact.configs.flat.recommended,
|
|
13
13
|
];
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -863,7 +863,7 @@ class wgtNodeUtils {
|
|
|
863
863
|
*/
|
|
864
864
|
seoFun = ({ url, name, image, author, aggregateRating, description, hostname, languageList, lang, title }) => {
|
|
865
865
|
const pathWithoutLang = url ? url.replace(/(https?:\/\/[^/]+)\/en\b/, "$1") : '/';
|
|
866
|
-
const seoRenderLdJson = this.renderLdJson({
|
|
866
|
+
const seoRenderLdJson = this.renderLdJson({ pathWithoutLang, name, image, author, aggregateRating, description, hostname });
|
|
867
867
|
const seoRenderAlternateLink = this.renderAlternateLink({ languageList, url, pathWithoutLang });
|
|
868
868
|
const seoraphAndTwitterFun = this.graphAndTwitterFun({ image, url, title, hostname, description, lang, pathWithoutLang });
|
|
869
869
|
const seoContent = {
|
|
@@ -939,6 +939,7 @@ class wgtNodeUtils {
|
|
|
939
939
|
href: item.code === 'en' ? pathWithoutLang : url
|
|
940
940
|
}));
|
|
941
941
|
languageLinkList.push({ rel: 'alternate', hrefLang: 'x-default', href: pathWithoutLang });
|
|
942
|
+
languageLinkList.push({ rel: 'canonical', href: pathWithoutLang });
|
|
942
943
|
return languageLinkList
|
|
943
944
|
}
|
|
944
945
|
// Open Graph 和 Twitter Card 站外引流触点
|