diff --git a/theme/src/client/composables/blog.ts b/theme/src/client/composables/blog.ts index 955b6317..94a45759 100644 --- a/theme/src/client/composables/blog.ts +++ b/theme/src/client/composables/blog.ts @@ -197,7 +197,7 @@ export function useTags() { return Object.keys(tagMap).map(tag => ({ name: tag, count: tagMap[tag] > 99 ? '99+' : tagMap[tag], - colors: extraData.value.tagsColorsPreset[extraData.value.tagsColors[tag]], + colors: extraData.value.tagsColorsPreset[extraData.value.tagsColors[tag]] ?? [], })) }) diff --git a/theme/src/client/index.ts b/theme/src/client/index.ts index 37e36685..b499d7b3 100644 --- a/theme/src/client/index.ts +++ b/theme/src/client/index.ts @@ -5,6 +5,8 @@ export { default as plumeClientConfig } from './config.js' export { default as Layout } from './layouts/Layout.vue' export { default as NotFound } from './layouts/NotFound.vue' +export { default as HomeBox } from './components/Home/HomeBox.vue' + export { useDarkMode, useThemeData, diff --git a/theme/src/node/plugins.ts b/theme/src/node/plugins.ts index 7e69e8d4..47b0fc00 100644 --- a/theme/src/node/plugins.ts +++ b/theme/src/node/plugins.ts @@ -107,8 +107,18 @@ export function setupPlugins( ...customContainers, ] - if (options.readingTime !== false) - plugins.push(readingTimePlugin(options.readingTime || {})) + if (options.readingTime !== false) { + plugins.push(readingTimePlugin({ + locales: { + '/zh/': { + word: '$word字', + less1Minute: '小于1分钟', + time: '大约$time分钟', + }, + }, + ...options.readingTime, + })) + } if (options.nprogress !== false) plugins.push(nprogressPlugin()) @@ -183,7 +193,6 @@ export function setupPlugins( align: true, mark: true, tasklist: true, - demo: true, attrs: true, sup: true, sub: true, @@ -203,7 +212,6 @@ export function setupPlugins( plugins.push(baiduTongjiPlugin(options.baiduTongji)) const hostname = resolveLocaleOptions(localeOptions, 'hostname') - if (options.sitemap !== false && hostname && isProd) plugins.push(sitemapPlugin({ hostname })) diff --git a/theme/src/node/setupPages.ts b/theme/src/node/setupPages.ts index 08dd18f5..4382e66b 100644 --- a/theme/src/node/setupPages.ts +++ b/theme/src/node/setupPages.ts @@ -80,14 +80,20 @@ export function autoCategory( options: PlumeThemeLocaleOptions, ) { const pagePath = page.filePathRelative + if (page.frontmatter.type || !pagePath) return const locales = Object.keys(resolvedAppLocales(app)) const notesLinks: string[] = [] for (const [, locale] of locales.entries()) { - const notes = options.locales?.[locale]?.notes - if (notes && notes.link) - notesLinks.push(path.join(locale, notes.link).replace(/\\+/g, '/')) + const config = options.locales?.[locale]?.notes + if (config && config.notes) { + notesLinks.push( + ...config.notes.map( + note => path.join(locale, config.link || '', note.link).replace(/\\+/g, '/'), + ), + ) + } } if (notesLinks.some(link => page.path.startsWith(link))) return diff --git a/theme/src/shared/frontmatter.ts b/theme/src/shared/frontmatter.ts index 5bc0ccc4..5a7af689 100644 --- a/theme/src/shared/frontmatter.ts +++ b/theme/src/shared/frontmatter.ts @@ -95,8 +95,6 @@ export interface PlumeThemeHomeProfile extends PlumeHomeConfigBase { export interface PlumeThemeHomeCustom extends PlumeHomeConfigBase { type: 'custom' - backgroundImage?: string | { light: string, dark: string } - backgroundAttachment?: 'fixed' | 'local' } /* =============================== Home end ==================================== */