Skip to content

Commit

Permalink
fix(page-properties): failed to supply page properties when urls cont…
Browse files Browse the repository at this point in the history
…ains uppercase chars (#241)

Signed-off-by: Neko Ayaka <[email protected]>
  • Loading branch information
nekomeowww authored Jun 23, 2024
1 parent 2407864 commit 9c4471d
Show file tree
Hide file tree
Showing 10 changed files with 3 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 ++]
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ++]
Expand Down
2 changes: 0 additions & 2 deletions docs/pages/en/releases/migrations/v1-to-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ++]
},
},
Expand Down Expand Up @@ -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 ++]
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ++]
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 ++]
Expand Down
2 changes: 0 additions & 2 deletions docs/pages/zh-CN/releases/migrations/v1-to-v2.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ++]
},
},
Expand Down Expand Up @@ -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 ++]
},
},
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export function usePageProperties(pageData: Ref<PageData>, 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 []
Expand All @@ -82,7 +82,7 @@ export function usePageProperties(pageData: Ref<PageData>, userConfiguredPagePro
})
}),
data: computed<Data[string]>(() => {
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 }
Expand Down

0 comments on commit 9c4471d

Please sign in to comment.