diff --git a/docs/pages/en/integrations/markdown-it-bi-directional-links/getting-started.md b/docs/pages/en/integrations/markdown-it-bi-directional-links/getting-started.md index 9d8ce45e..3a9500cd 100644 --- a/docs/pages/en/integrations/markdown-it-bi-directional-links/getting-started.md +++ b/docs/pages/en/integrations/markdown-it-bi-directional-links/getting-started.md @@ -45,7 +45,6 @@ export default defineConfigWithTheme({ }, markdown: { config: (md) => { - // @ts-expect-error unmatched type for VitePress, ref https://github.com/nolebase/integrations/pull/228 [!code ++] md.use(BiDirectionalLinks()) // [!code ++] }, }, diff --git a/docs/pages/en/integrations/vitepress-plugin-inline-link-preview/configuration.md b/docs/pages/en/integrations/vitepress-plugin-inline-link-preview/configuration.md index c9f63806..346ce382 100644 --- a/docs/pages/en/integrations/vitepress-plugin-inline-link-preview/configuration.md +++ b/docs/pages/en/integrations/vitepress-plugin-inline-link-preview/configuration.md @@ -322,7 +322,6 @@ export default defineConfig({ markdown: { config(md) { // other markdown-it configurations... - // @ts-expect-error unmatched type for VitePress, ref https://github.com/nolebase/integrations/pull/228 [!code ++] md.use(InlineLinkPreviewElementTransform, { tag: 'YourComponentName' }) // [!code focus] } } diff --git a/docs/pages/en/integrations/vitepress-plugin-inline-link-preview/getting-started.md b/docs/pages/en/integrations/vitepress-plugin-inline-link-preview/getting-started.md index 138edd74..161081a9 100644 --- a/docs/pages/en/integrations/vitepress-plugin-inline-link-preview/getting-started.md +++ b/docs/pages/en/integrations/vitepress-plugin-inline-link-preview/getting-started.md @@ -57,7 +57,6 @@ export default defineConfig({ markdown: { // [!code ++] config(md) { // [!code ++] // other markdown-it configurations... // [!code ++] - // @ts-expect-error unmatched type for VitePress, ref https://github.com/nolebase/integrations/pull/228 [!code ++] md.use(InlineLinkPreviewElementTransform) // [!code ++] } // [!code ++] } // [!code ++] diff --git a/docs/pages/en/releases/migrations/v1-to-v2.md b/docs/pages/en/releases/migrations/v1-to-v2.md index f70ba212..b2a6c2f8 100644 --- a/docs/pages/en/releases/migrations/v1-to-v2.md +++ b/docs/pages/en/releases/migrations/v1-to-v2.md @@ -71,7 +71,6 @@ export default defineConfig({ markdown: { // ... config: (md) => { - // @ts-expect-error unmatched type for VitePress, ref https://github.com/nolebase/integrations/pull/228 [!code ++] md.use(InlineLinkPreviewElementTransform) // [!code ++] }, }, @@ -120,7 +119,6 @@ export default defineConfig({ } as ElementTransformOptions // [!code --] })()) // [!code --] - // @ts-expect-error unmatched type for VitePress, ref https://github.com/nolebase/integrations/pull/228 [!code ++] md.use(InlineLinkPreviewElementTransform) // [!code ++] }, }, diff --git a/docs/pages/zh-CN/integrations/markdown-it-bi-directional-links/getting-started.md b/docs/pages/zh-CN/integrations/markdown-it-bi-directional-links/getting-started.md index 41ebc349..0a842d72 100644 --- a/docs/pages/zh-CN/integrations/markdown-it-bi-directional-links/getting-started.md +++ b/docs/pages/zh-CN/integrations/markdown-it-bi-directional-links/getting-started.md @@ -41,7 +41,6 @@ export default defineConfigWithTheme({ }, markdown: { config: (md) => { - // @ts-expect-error unmatched type for VitePress, ref https://github.com/nolebase/integrations/pull/228 [!code ++] md.use(BiDirectionalLinks()) // [!code ++] }, }, diff --git a/docs/pages/zh-CN/integrations/vitepress-plugin-inline-link-preview/configuration.md b/docs/pages/zh-CN/integrations/vitepress-plugin-inline-link-preview/configuration.md index 47e59006..323b799b 100644 --- a/docs/pages/zh-CN/integrations/vitepress-plugin-inline-link-preview/configuration.md +++ b/docs/pages/zh-CN/integrations/vitepress-plugin-inline-link-preview/configuration.md @@ -317,7 +317,6 @@ export default defineConfig({ markdown: { config(md) { // other markdown-it configurations... - // @ts-expect-error unmatched type for VitePress, ref https://github.com/nolebase/integrations/pull/228 [!code ++] md.use(InlineLinkPreviewElementTransform, { tag: 'YourComponentName' }) // [!code focus] } } diff --git a/docs/pages/zh-CN/integrations/vitepress-plugin-inline-link-preview/getting-started.md b/docs/pages/zh-CN/integrations/vitepress-plugin-inline-link-preview/getting-started.md index d8225229..706b8d83 100644 --- a/docs/pages/zh-CN/integrations/vitepress-plugin-inline-link-preview/getting-started.md +++ b/docs/pages/zh-CN/integrations/vitepress-plugin-inline-link-preview/getting-started.md @@ -57,7 +57,6 @@ export default defineConfig({ markdown: { // [!code ++] config(md) { // [!code ++] // 其他 markdown-it 配置... // [!code ++] - // @ts-expect-error unmatched type for VitePress, ref https://github.com/nolebase/integrations/pull/228 [!code ++] md.use(InlineLinkPreviewElementTransform) // [!code ++] } // [!code ++] } // [!code ++] diff --git a/docs/pages/zh-CN/releases/migrations/v1-to-v2.md b/docs/pages/zh-CN/releases/migrations/v1-to-v2.md index 2599f212..628e5b1e 100644 --- a/docs/pages/zh-CN/releases/migrations/v1-to-v2.md +++ b/docs/pages/zh-CN/releases/migrations/v1-to-v2.md @@ -71,7 +71,6 @@ export default defineConfig({ markdown: { // ... config: (md) => { - // @ts-expect-error unmatched type for VitePress, ref https://github.com/nolebase/integrations/pull/228 [!code ++] md.use(InlineLinkPreviewElementTransform) // [!code ++] }, }, @@ -120,7 +119,6 @@ export default defineConfig({ } as ElementTransformOptions // [!code --] })()) // [!code --] - // @ts-expect-error unmatched type for VitePress, ref https://github.com/nolebase/integrations/pull/228 [!code ++] md.use(InlineLinkPreviewElementTransform) // [!code ++] }, }, diff --git a/package.json b/package.json index b03eb17c..4a67d7e1 100644 --- a/package.json +++ b/package.json @@ -22,6 +22,7 @@ "lint": "eslint --cache .", "dev": "pnpm run packages:stub && pnpm run docs:dev", "build": "pnpm run packages:build && pnpm run docs:build", + "preview": "pnpm run docs:preview", "docs:dev": "pnpm -r --filter=./docs run dev", "docs:build": "pnpm -r --filter=./docs run build", "docs:preview": "pnpm -r --filter=./docs run preview", diff --git a/packages/vitepress-plugin-page-properties/src/client/composables/data.ts b/packages/vitepress-plugin-page-properties/src/client/composables/data.ts index 9a8547de..c852d168 100644 --- a/packages/vitepress-plugin-page-properties/src/client/composables/data.ts +++ b/packages/vitepress-plugin-page-properties/src/client/composables/data.ts @@ -63,7 +63,7 @@ export function usePageProperties(pageData: Ref, userConfiguredPagePro if (!userConfiguredPageProperties.value || !userConfiguredPageProperties.value.length) return [] - const currentPath = toValue(pageData.value.filePath) + const currentPath = toValue(pageData.value.filePath).toLowerCase() const matchedPagePropertiesForCurrentPath = pagePropertiesData.value[currentPath] if (!matchedPagePropertiesForCurrentPath || !Object.keys(matchedPagePropertiesForCurrentPath).length) return [] @@ -82,7 +82,7 @@ export function usePageProperties(pageData: Ref, userConfiguredPagePro }) }), data: computed(() => { - const currentPath = toValue(pageData.value.filePath) + const currentPath = toValue(pageData.value.filePath).toLowerCase() const matchedPagePropertiesForCurrentPath = pagePropertiesData.value[currentPath] if (!matchedPagePropertiesForCurrentPath || !Object.keys(matchedPagePropertiesForCurrentPath).length) return { readingTime: 0, wordsCount: 0 }