nuxt-seo-utils 6.0.10 → 6.0.11
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/module.json
CHANGED
|
@@ -3,7 +3,7 @@ import { createSitePathResolver } from "#site-config/app/composables/utils";
|
|
|
3
3
|
import { useHead, useSeoMeta } from "@unhead/vue";
|
|
4
4
|
import { useError, useRoute, useRuntimeConfig } from "nuxt/app";
|
|
5
5
|
import { stringifyQuery } from "ufo";
|
|
6
|
-
import { computed } from "vue";
|
|
6
|
+
import { computed, ref, watch } from "vue";
|
|
7
7
|
export function applyDefaults(i18n) {
|
|
8
8
|
const { canonicalQueryWhitelist } = useRuntimeConfig().public["seo-utils"];
|
|
9
9
|
const siteConfig = useSiteConfig();
|
|
@@ -21,13 +21,21 @@ export function applyDefaults(i18n) {
|
|
|
21
21
|
);
|
|
22
22
|
return Object.keys(filteredQuery).length ? `${url}?${stringifyQuery(filteredQuery)}` : url;
|
|
23
23
|
});
|
|
24
|
+
const templateParams = ref({ site: siteConfig, siteName: siteConfig.name });
|
|
25
|
+
if (import.meta.client) {
|
|
26
|
+
watch(siteConfig, (v) => {
|
|
27
|
+
templateParams.value = { site: v, siteName: v.name || "" };
|
|
28
|
+
}, {
|
|
29
|
+
deep: true
|
|
30
|
+
});
|
|
31
|
+
}
|
|
24
32
|
const minimalPriority = {
|
|
25
33
|
// give nuxt.config values higher priority
|
|
26
34
|
tagPriority: 101
|
|
27
35
|
};
|
|
28
36
|
useHead({
|
|
29
37
|
htmlAttrs: { lang: i18n.locale },
|
|
30
|
-
templateParams
|
|
38
|
+
templateParams,
|
|
31
39
|
titleTemplate: "%s %separator %siteName",
|
|
32
40
|
link: [{ rel: "canonical", href: () => canonicalUrl.value }]
|
|
33
41
|
}, minimalPriority);
|
|
@@ -35,10 +43,10 @@ export function applyDefaults(i18n) {
|
|
|
35
43
|
ogType: "website",
|
|
36
44
|
ogUrl: () => canonicalUrl.value,
|
|
37
45
|
ogLocale: () => i18n.locale.value,
|
|
38
|
-
ogSiteName:
|
|
46
|
+
ogSiteName: "%siteName",
|
|
47
|
+
ogDescription: "%site.description"
|
|
39
48
|
};
|
|
40
|
-
|
|
41
|
-
seoMeta.description = siteConfig.description;
|
|
49
|
+
seoMeta.description = "%site.description";
|
|
42
50
|
if (siteConfig.twitter) {
|
|
43
51
|
const id = siteConfig.twitter.startsWith("@") ? siteConfig.twitter : `@${siteConfig.twitter}`;
|
|
44
52
|
seoMeta.twitterCreator = id;
|
|
@@ -9,11 +9,7 @@ export default defineNuxtPlugin({
|
|
|
9
9
|
},
|
|
10
10
|
// we need to wait for the i18n plugin to run first
|
|
11
11
|
// @ts-expect-error dynamic
|
|
12
|
-
dependsOn:
|
|
13
|
-
"nuxt-site-config:i18n"
|
|
14
|
-
] : [
|
|
15
|
-
"i18n:plugin"
|
|
16
|
-
],
|
|
12
|
+
dependsOn: ["nuxt-site-config:i18n"],
|
|
17
13
|
setup(nuxtApp) {
|
|
18
14
|
const siteConfig = useSiteConfig();
|
|
19
15
|
const locale = ref(nuxtApp.$i18n?.locale?.value || siteConfig.currentLocale || siteConfig.defaultLocale);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-seo-utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.0.
|
|
4
|
+
"version": "6.0.11",
|
|
5
5
|
"description": "SEO utilities to improve your Nuxt sites discoverability and shareability",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"funding": "https://github.com/sponsors/harlan-zw",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"fast-glob": "^3.3.3",
|
|
41
41
|
"image-size": "^1.2.0",
|
|
42
42
|
"mlly": "^1.7.4",
|
|
43
|
-
"nuxt-site-config": "^3.0
|
|
43
|
+
"nuxt-site-config": "^3.1.0",
|
|
44
44
|
"pathe": "^2.0.3",
|
|
45
45
|
"scule": "^1.3.0",
|
|
46
46
|
"ufo": "^1.5.4"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
49
|
-
"@antfu/eslint-config": "4.
|
|
49
|
+
"@antfu/eslint-config": "4.3.0",
|
|
50
50
|
"@nuxt/module-builder": "^0.8.4",
|
|
51
51
|
"@nuxt/test-utils": "^3.15.4",
|
|
52
52
|
"@nuxt/ui": "^2.21.0",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"case-police": "^1.0.0",
|
|
60
60
|
"cheerio": "1.0.0",
|
|
61
61
|
"eslint": "^9.20.1",
|
|
62
|
-
"happy-dom": "^17.1.
|
|
62
|
+
"happy-dom": "^17.1.1",
|
|
63
63
|
"markdownlint-cli": "^0.44.0",
|
|
64
64
|
"nuxt": "^3.15.4",
|
|
65
65
|
"nuxt-content-twoslash": "^0.1.2",
|