Skip to content

Commit

Permalink
tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
abernier committed Aug 11, 2024
1 parent c39f32a commit 54a4cf9
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/utils/docs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,11 +140,9 @@ async function _getDocs(
// Calculate the relative path from the file path after the root
const relativePath = file.substring(normalizedRoot.length) // "/advanced/performance.md"
// Extract the directory path from the relative path (excluding the file name)
const directoryPath = relativePath.split('/').slice(0, -1).join('/') // "advanced"
// Combine the lastFolderName with the directoryPath using template literals
const folderPath = `/${lastFolderName}/${directoryPath}` // "/docs/advanced"
const directoryPath = relativePath.split('/').slice(0, -1).join('/') // "/advanced"

const url = `${inlineImagesOrigin}${folderPath}/${src}` // "https://github.com/pmndrs/uikit/raw/main/docs/advanced/./basic-example.gif"
const url = `${inlineImagesOrigin}/${lastFolderName}${directoryPath}/${src}` // "https://github.com/pmndrs/uikit/raw/main/docs/advanced/./basic-example.gif"

return `${prefix}${url}${suffix}`
}
Expand Down

0 comments on commit 54a4cf9

Please sign in to comment.