nuxt-seo-utils 8.5.0 → 8.5.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/dist/cli.mjs
CHANGED
|
@@ -9,7 +9,7 @@ import { p as pngToIco } from './shared/nuxt-seo-utils.NAV2YNQn.mjs';
|
|
|
9
9
|
import 'node:buffer';
|
|
10
10
|
|
|
11
11
|
const name = "nuxt-seo-utils";
|
|
12
|
-
const version = "8.5.
|
|
12
|
+
const version = "8.5.2";
|
|
13
13
|
const description = "SEO utilities to improve your Nuxt sites discoverability and shareability";
|
|
14
14
|
|
|
15
15
|
const ICON_SIZES = [
|
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -377,7 +377,7 @@ function addGeneratedRouteRule(nuxt, route, generatedRule) {
|
|
|
377
377
|
nitroRouteRules[route] = defu(nitroRouteRules[route], structuredClone(rule));
|
|
378
378
|
}
|
|
379
379
|
async function generateTagsFromPageDirImages(nuxt = useNuxt()) {
|
|
380
|
-
const pagesDirs = nuxt.options._layers.map((layer) => resolve(layer.config.
|
|
380
|
+
const pagesDirs = nuxt.options._layers.map((layer) => resolve(layer.config.srcDir || layer.cwd, layer.config.dir?.pages || "pages")).filter((dir) => fs.existsSync(dir));
|
|
381
381
|
const appendRouteRules = {};
|
|
382
382
|
const registeredFiles = /* @__PURE__ */ new Set();
|
|
383
383
|
const devMiddlewareMap = {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { useError, useRoute } from "nuxt/app";
|
|
1
|
+
import { useError, useNuxtApp, useRoute } from "nuxt/app";
|
|
2
2
|
import { titleCase } from "scule";
|
|
3
3
|
import { withoutTrailingSlash } from "ufo";
|
|
4
4
|
import { computed } from "vue";
|
|
@@ -8,9 +8,16 @@ export function useFallbackTitle() {
|
|
|
8
8
|
const err = useError();
|
|
9
9
|
let i18n;
|
|
10
10
|
try {
|
|
11
|
-
i18n =
|
|
11
|
+
i18n = useNuxtApp().$i18n;
|
|
12
12
|
} catch {
|
|
13
13
|
}
|
|
14
|
+
if (!i18n) {
|
|
15
|
+
try {
|
|
16
|
+
i18n = useI18n();
|
|
17
|
+
} catch {
|
|
18
|
+
console.warn("[nuxt-seo-utils] useFallbackTitle: could not resolve the i18n instance. Titles will not be resolved from i18n messages.");
|
|
19
|
+
}
|
|
20
|
+
}
|
|
14
21
|
return computed(() => {
|
|
15
22
|
if (err.value?.statusCode && [404, 500].includes(err.value.statusCode)) {
|
|
16
23
|
return `${err.value.statusCode} - ${err.value.message}`;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nuxt-seo-utils",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "8.5.
|
|
4
|
+
"version": "8.5.2",
|
|
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",
|
|
@@ -123,7 +123,9 @@
|
|
|
123
123
|
"prepare:fixtures": "nuxt prepare test/fixtures/basic && nuxt prepare test/fixtures/i18n && nuxt prepare test/fixtures/csp",
|
|
124
124
|
"test": "vitest && pnpm test:nuxt5",
|
|
125
125
|
"test:run": "vitest run --exclude '**/\\_\\_runtime\\_\\_/**'",
|
|
126
|
-
"test:runtime": "
|
|
126
|
+
"test:runtime": "pnpm test:runtime:basic && pnpm test:runtime:i18n",
|
|
127
|
+
"test:runtime:basic": "cd test/fixtures/basic && vitest --run",
|
|
128
|
+
"test:runtime:i18n": "cd test/fixtures/i18n && vitest --run",
|
|
127
129
|
"test:nuxt5": "pnpm pack --out test/fixtures/nuxt5/module.tgz && node test/fixtures/nuxt5/run.mjs",
|
|
128
130
|
"release": "pnpm build && bumpp -x \"npx changelogen --output=CHANGELOG.md\"",
|
|
129
131
|
"lint:docs": "markdownlint ./docs/content && case-police 'docs/content/**/*.md' *.md",
|