diff --git a/plugins/plugin-notes-data/src/node/prepareNotesData.ts b/plugins/plugin-notes-data/src/node/prepareNotesData.ts index c68ce8f8..acf4e32c 100644 --- a/plugins/plugin-notes-data/src/node/prepareNotesData.ts +++ b/plugins/plugin-notes-data/src/node/prepareNotesData.ts @@ -83,7 +83,10 @@ export function watchNotesData(app: App, watchers: any[], options: NotesDataOpti if (!allOptions.length) return - const [firstLink, ...links] = allOptions.map(option => option.link) + const [firstLink, ...links] = allOptions.map(option => option.link).filter(Boolean) + + if (!firstLink) + return const dir = path.join('pages', firstLink, '**/*') const watcher = chokidar.watch(dir, { diff --git a/theme/src/client/components/Home.vue b/theme/src/client/components/Home.vue index be40bfc4..4198ae29 100644 --- a/theme/src/client/components/Home.vue +++ b/theme/src/client/components/Home.vue @@ -25,15 +25,15 @@ const homeStyle = computed(() => { mask.value ? `linear-gradient(rgba(0, 0, 0, ${mask.value}), rgba(0, 0, 0, ${mask.value}))` : '', - `url(${withBase(matter.value.banner || '')})`, + `url(${withBase(matter.value.banner ?? 'https://pengzhanbo.cn/images/home-banner.jpg')})`, ] .filter(Boolean) .join(','), } }) -const name = computed(() => matter.value.hero?.name) -const tagline = computed(() => matter.value.hero?.tagline) +const name = computed(() => matter.value.hero?.name ?? 'Plume') +const tagline = computed(() => matter.value.hero?.tagline ?? 'A VuePress Theme') const text = computed(() => matter.value.hero?.text) const actions = computed(() => { @@ -44,7 +44,7 @@ const actions = computed(() => {