Skip to content

Commit 9fc8f6b

Browse files
authored
fix(docitem): render frontMatter.head tags so custom canonicals reach built HTML (#879)
Signed-off-by: amaan-bhati <amaanbhati49@gmail.com>
1 parent 55f5f83 commit 9fc8f6b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/theme/DocItem/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,12 @@ export default function DocItem(props) {
237237
{JSON.stringify(articleSchema)}
238238
</script>
239239
)}
240+
{Array.isArray(frontMatter.head) &&
241+
frontMatter.head.map((headTag, i) => {
242+
if (!headTag?.tag) return null;
243+
const {tag: tagName, attrs = {}} = headTag;
244+
return React.createElement(tagName, {key: i, ...attrs});
245+
})}
240246
</Head>
241247
<div className="row">
242248
<div

0 commit comments

Comments
 (0)