Skip to content

Commit

Permalink
fix(docs): page config with slash on the end not found
Browse files Browse the repository at this point in the history
  • Loading branch information
m0ksem committed Apr 12, 2023
1 parent 5b04fb6 commit b08cc0b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/docs/modules/page-config/runtime/usePageConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,13 @@ const files = Object.entries(import.meta.glob<PageConfigJSModule>('@/page-config
}, {} as Record<string, () => Promise<PageConfigJSModule>>)

const getConfig = async (name: string) => {
const file = files[unref(name)]
name = unref(name)

if (name.endsWith('/')) {
name = name.slice(0, -1)
}

const file = files[name]

if (!file) {
console.log(`Page config ${name} not found`)
Expand Down

0 comments on commit b08cc0b

Please sign in to comment.