unhead 1.0.2 → 1.0.4
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 +3 -2
- package/dist/index.mjs +3 -2
- package/package.json +6 -6
package/dist/index.cjs
CHANGED
|
@@ -264,7 +264,7 @@ const renderTitleTemplate = (template, title) => {
|
|
|
264
264
|
return template.replace("%s", title ?? "");
|
|
265
265
|
};
|
|
266
266
|
function resolveTitleTemplateFromTags(tags) {
|
|
267
|
-
|
|
267
|
+
let titleTemplateIdx = tags.findIndex((i) => i.tag === "titleTemplate");
|
|
268
268
|
const titleIdx = tags.findIndex((i) => i.tag === "title");
|
|
269
269
|
if (titleIdx !== -1 && titleTemplateIdx !== -1) {
|
|
270
270
|
const newTitle = renderTitleTemplate(
|
|
@@ -283,6 +283,7 @@ function resolveTitleTemplateFromTags(tags) {
|
|
|
283
283
|
if (newTitle !== null) {
|
|
284
284
|
tags[titleTemplateIdx].children = newTitle;
|
|
285
285
|
tags[titleTemplateIdx].tag = "title";
|
|
286
|
+
titleTemplateIdx = -1;
|
|
286
287
|
}
|
|
287
288
|
}
|
|
288
289
|
if (titleTemplateIdx !== -1) {
|
|
@@ -558,7 +559,7 @@ const TagEntityBits = 10;
|
|
|
558
559
|
|
|
559
560
|
async function normaliseEntryTags(e) {
|
|
560
561
|
const tagPromises = [];
|
|
561
|
-
Object.entries(e.input).filter(([k, v]) => typeof v !== "undefined" && ValidHeadTags.includes(k)).forEach(([k, value]) => {
|
|
562
|
+
Object.entries(e.resolvedInput || e.input).filter(([k, v]) => typeof v !== "undefined" && ValidHeadTags.includes(k)).forEach(([k, value]) => {
|
|
562
563
|
const v = asArray(value);
|
|
563
564
|
tagPromises.push(...v.map((props) => normaliseTag(k, props)).flat());
|
|
564
565
|
});
|
package/dist/index.mjs
CHANGED
|
@@ -262,7 +262,7 @@ const renderTitleTemplate = (template, title) => {
|
|
|
262
262
|
return template.replace("%s", title ?? "");
|
|
263
263
|
};
|
|
264
264
|
function resolveTitleTemplateFromTags(tags) {
|
|
265
|
-
|
|
265
|
+
let titleTemplateIdx = tags.findIndex((i) => i.tag === "titleTemplate");
|
|
266
266
|
const titleIdx = tags.findIndex((i) => i.tag === "title");
|
|
267
267
|
if (titleIdx !== -1 && titleTemplateIdx !== -1) {
|
|
268
268
|
const newTitle = renderTitleTemplate(
|
|
@@ -281,6 +281,7 @@ function resolveTitleTemplateFromTags(tags) {
|
|
|
281
281
|
if (newTitle !== null) {
|
|
282
282
|
tags[titleTemplateIdx].children = newTitle;
|
|
283
283
|
tags[titleTemplateIdx].tag = "title";
|
|
284
|
+
titleTemplateIdx = -1;
|
|
284
285
|
}
|
|
285
286
|
}
|
|
286
287
|
if (titleTemplateIdx !== -1) {
|
|
@@ -556,7 +557,7 @@ const TagEntityBits = 10;
|
|
|
556
557
|
|
|
557
558
|
async function normaliseEntryTags(e) {
|
|
558
559
|
const tagPromises = [];
|
|
559
|
-
Object.entries(e.input).filter(([k, v]) => typeof v !== "undefined" && ValidHeadTags.includes(k)).forEach(([k, value]) => {
|
|
560
|
+
Object.entries(e.resolvedInput || e.input).filter(([k, v]) => typeof v !== "undefined" && ValidHeadTags.includes(k)).forEach(([k, value]) => {
|
|
560
561
|
const v = asArray(value);
|
|
561
562
|
tagPromises.push(...v.map((props) => normaliseTag(k, props)).flat());
|
|
562
563
|
});
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "unhead",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
5
|
-
"packageManager": "pnpm@7.
|
|
4
|
+
"version": "1.0.4",
|
|
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",
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"dist"
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"
|
|
34
|
-
"@unhead/
|
|
35
|
-
"
|
|
33
|
+
"hookable": "^5.4.2",
|
|
34
|
+
"@unhead/dom": "1.0.4",
|
|
35
|
+
"@unhead/schema": "1.0.4"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"zhead": "^1.0.
|
|
38
|
+
"zhead": "^1.0.4"
|
|
39
39
|
},
|
|
40
40
|
"scripts": {
|
|
41
41
|
"build": "unbuild .",
|