Skip to content

Commit

Permalink
Fix build
Browse files Browse the repository at this point in the history
  • Loading branch information
prokawsar committed Nov 26, 2024
1 parent 628598a commit a7edc0f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mdsvex.config.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
// import remarkPlugins from './src/plugins/remark/index.js';
import { base } from '$app/paths'
import relativeImages from 'mdsvex-relative-images'
import rehypeExternalLinks from 'rehype-external-links'
import rehypePlugins from './src/plugins/rehype/index.js'

const BASE_PATH = process.env.BASE_PATH || ''

export default {
extensions: ['.md'],
smartypants: {
Expand All @@ -23,7 +24,7 @@ export default {
if (node.type === 'element' && node.tagName === 'img') {
// Check if src is a relative path
if (node.properties.src && !node.properties.src.startsWith('http')) {
node.properties.src = `${base}${node.properties.src}`.replace(/^\.?\/?/, '/')
node.properties.src = `${BASE_PATH}${node.properties.src}`.replace(/^\.?\/?/, '/')
}
}
return node
Expand Down

0 comments on commit a7edc0f

Please sign in to comment.