fix: injection of frontmatter.head fails when it does not exist

This commit is contained in:
Northword 2023-09-23 17:33:02 +08:00 committed by GitHub
parent 98d641ee52
commit e14b1a8bf1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -8,6 +8,7 @@ export const baiduTongjiPlugin = ({ key = '' }: BaiduTongjiOptions): Plugin => {
return {
name: '@vuepress-plume/vuepress-plugin-baidu-tongji',
extendsPage: (page) => {
page.frontmatter.head = page.frontmatter.head || [];
page.frontmatter.head?.push([
'script',
{