Fix asset publishing by adding /img/user/ prefix for Quartz compatibility#83
Fix asset publishing by adding /img/user/ prefix for Quartz compatibility#83
Conversation
Co-authored-by: saberzero1 <8161064+saberzero1@users.noreply.github.com>
…nent Co-authored-by: saberzero1 <8161064+saberzero1@users.noreply.github.com>
saberzero1
left a comment
There was a problem hiding this comment.
Hey,
The proposed change is not addressing the core issue at all.
The core issue is the paths of assets not getting rewritten properly when vaultPath is not set to the default "/" or "".
Notes paths and links between notes are properly rewritten to account for this. However, non-markdown files and embeds seem to still have the prefix.
Thanks.
Co-authored-by: saberzero1 <8161064+saberzero1@users.noreply.github.com>
You're absolutely right. I've fixed the core issue by applying the same path rewriting logic used for notes to asset paths. The fix now properly removes vaultPath prefixes before adding the |
Please don't add |
saberzero1
left a comment
There was a problem hiding this comment.
Please don't add /img/user/ prefix. Simply remove the vaultPath from a link to an asset if that link starts with the configured vaultPath.
…paths Co-authored-by: saberzero1 <8161064+saberzero1@users.noreply.github.com>
Understood. I've removed the |
This has already been implemented in commit 61f0239. The code now removes the |
Problem
Assets (images like
.webpfiles) were not being published to Quartz sites, even though they displayed correctly in Obsidian. Users reported seeing images in their Obsidian vault but finding them missing on their published Quartz websites.Example scenario:
Selerim Wiki/z_assets/albert_dente.webp![[albert_dente.webp]]Root Cause
The issue was in
SyncerPageCompiler.convertFileLinks()where asset paths were being stored with raw file paths instead of Quartz-compatible paths:Quartz expects assets to be published with the
/img/user/prefix to function correctly.Solution
Fixed asset path transformation to use the proper Quartz format:
Key Changes
/img/user/prefix to all asset paths for Quartz compatibility%20replacement (not full URL encoding) to match expected format![[image.png]]→→Testing
Impact
Before:
![[albert_dente.webp]]→ Asset missing on published siteAfter:
![[albert_dente.webp]]→→ ✅ Asset visible on published siteThis fix ensures that assets from any vault structure will be published correctly to Quartz sites and accessible at the expected
/img/user/URLs.Fixes #82.
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.