@unhead/vue 1.0.2 → 1.0.3
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/index.cjs +2 -1
- package/dist/index.mjs +2 -1
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -324,7 +324,7 @@ const renderTitleTemplate = (template, title) => {
|
|
|
324
324
|
return template.replace("%s", title ?? "");
|
|
325
325
|
};
|
|
326
326
|
function resolveTitleTemplateFromTags(tags) {
|
|
327
|
-
|
|
327
|
+
let titleTemplateIdx = tags.findIndex((i) => i.tag === "titleTemplate");
|
|
328
328
|
const titleIdx = tags.findIndex((i) => i.tag === "title");
|
|
329
329
|
if (titleIdx !== -1 && titleTemplateIdx !== -1) {
|
|
330
330
|
const newTitle = renderTitleTemplate(
|
|
@@ -343,6 +343,7 @@ function resolveTitleTemplateFromTags(tags) {
|
|
|
343
343
|
if (newTitle !== null) {
|
|
344
344
|
tags[titleTemplateIdx].children = newTitle;
|
|
345
345
|
tags[titleTemplateIdx].tag = "title";
|
|
346
|
+
titleTemplateIdx = -1;
|
|
346
347
|
}
|
|
347
348
|
}
|
|
348
349
|
if (titleTemplateIdx !== -1) {
|
package/dist/index.mjs
CHANGED
|
@@ -322,7 +322,7 @@ const renderTitleTemplate = (template, title) => {
|
|
|
322
322
|
return template.replace("%s", title ?? "");
|
|
323
323
|
};
|
|
324
324
|
function resolveTitleTemplateFromTags(tags) {
|
|
325
|
-
|
|
325
|
+
let titleTemplateIdx = tags.findIndex((i) => i.tag === "titleTemplate");
|
|
326
326
|
const titleIdx = tags.findIndex((i) => i.tag === "title");
|
|
327
327
|
if (titleIdx !== -1 && titleTemplateIdx !== -1) {
|
|
328
328
|
const newTitle = renderTitleTemplate(
|
|
@@ -341,6 +341,7 @@ function resolveTitleTemplateFromTags(tags) {
|
|
|
341
341
|
if (newTitle !== null) {
|
|
342
342
|
tags[titleTemplateIdx].children = newTitle;
|
|
343
343
|
tags[titleTemplateIdx].tag = "title";
|
|
344
|
+
titleTemplateIdx = -1;
|
|
344
345
|
}
|
|
345
346
|
}
|
|
346
347
|
if (titleTemplateIdx !== -1) {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unhead/vue",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
5
|
-
"packageManager": "pnpm@7.
|
|
4
|
+
"version": "1.0.3",
|
|
5
|
+
"packageManager": "pnpm@7.17.0",
|
|
6
6
|
"author": "Harlan Wilton <harlan@harlanzw.com>",
|
|
7
7
|
"license": "MIT",
|
|
8
8
|
"funding": "https://github.com/sponsors/harlan-zw",
|
|
@@ -33,12 +33,12 @@
|
|
|
33
33
|
"vue": ">=2.7 || >=3"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"
|
|
37
|
-
"
|
|
36
|
+
"hookable": "^5.4.2",
|
|
37
|
+
"@unhead/schema": "1.0.3"
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
|
-
"
|
|
41
|
-
"
|
|
40
|
+
"vue": "^3.2.45",
|
|
41
|
+
"unhead": "1.0.3"
|
|
42
42
|
},
|
|
43
43
|
"scripts": {
|
|
44
44
|
"build": "unbuild .",
|