Skip to content

Commit

Permalink
Fix base path
Browse files Browse the repository at this point in the history
  • Loading branch information
prokawsar committed Nov 26, 2024
1 parent 2a079b7 commit 1b15616
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/static.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ jobs:
run: |
npm run build
- run: npm run build
- name: Add .nojekyll file
run: touch build/.nojekyll

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
Expand All @@ -51,5 +54,6 @@ jobs:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/deploy-pages@v1
- name: Deploy to GitHub Pages
uses: actions/deploy-pages@v1
id: deployment
2 changes: 1 addition & 1 deletion mdsvex.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,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_PATH + node.properties.src.replace(/^\.?\/?/, '/')
node.properties.src = `${BASE_PATH}${node.properties.src}`.replace(/\/\//, '/')
}
}
return node
Expand Down

0 comments on commit 1b15616

Please sign in to comment.