From 0782fe06f814938d340aae3009eb6666777152a3 Mon Sep 17 00:00:00 2001 From: pengzhanbo Date: Tue, 21 Nov 2023 02:32:08 +0800 Subject: [PATCH] fix(theme): `options.frontmatter` not defined fix `options.frontmatter` not be defined (#17) fix #17 --- packages/theme/src/node/autoFrontmatter.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/theme/src/node/autoFrontmatter.ts b/packages/theme/src/node/autoFrontmatter.ts index b4052a59..42046f97 100644 --- a/packages/theme/src/node/autoFrontmatter.ts +++ b/packages/theme/src/node/autoFrontmatter.ts @@ -11,8 +11,8 @@ import type { NotesItem } from '@vuepress-plume/vuepress-plugin-notes-data' import { format } from 'date-fns' import { customAlphabet } from 'nanoid' import type { - PlumeThemePluginOptions, - PlumeThemeLocaleOptions + PlumeThemeLocaleOptions, + PlumeThemePluginOptions } from '../shared/index.js' const nanoid = customAlphabet('0123456789abcdefghijklmnopqrstuvwxyz', 8) @@ -90,9 +90,9 @@ export default function autoFrontmatter( return dirList.length > 0 ? dirList[dirList.length - 1] : '' } return { - include: options.frontmatter.include ?? ['**/*.{md,MD}'], - exclude: options.frontmatter.exclude ?? ['.vuepress/**/*', 'node_modules'], - frontmatter: options.frontmatter.frontmatter ?? [ + include: options.frontmatter?.include ?? ['**/*.{md,MD}'], + exclude: options.frontmatter?.exclude ?? ['.vuepress/**/*', 'node_modules'], + frontmatter: options.frontmatter?.frontmatter ?? [ localesNotesDirs.length ? { // note 首页链接